diff options
author | Martin Fischer <martin@push-f.com> | 2021-11-22 15:57:17 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2021-11-22 15:57:17 +0100 |
commit | 346113bbebddbd199b61249957c7569514071e89 (patch) | |
tree | 82a1978a60faf93a00b5cc9ed4aa4f182b3d037f /tests/tests.rs | |
parent | a0ec23e259359bbbd115d6159193a361c8ce24df (diff) |
support other collections via #[collection(...)]
Diffstat (limited to 'tests/tests.rs')
-rw-r--r-- | tests/tests.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/tests.rs b/tests/tests.rs index 925fe72..1bff07f 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -251,3 +251,28 @@ trait FunIter { fn foobar2<H: Fn(&mut dyn Iterator<Item = &mut dyn Iterator<Item = Self::A>>)>(&mut self, f: H); } + +struct MyCollection<A, B, C>(A, B, C); +impl<A, B, C> IntoIterator for MyCollection<A, B, C> { + type Item = (A, B, C); + + type IntoIter = Box<dyn Iterator<Item = (A, B, C)>>; + + fn into_iter(self) -> Self::IntoIter { + todo!() + } +} + +impl<A, B, C> FromIterator<(A, B, C)> for MyCollection<A, B, C> { + fn from_iter<T: IntoIterator<Item = (A, B, C)>>(_iter: T) -> Self { + todo!() + } +} + +#[dynamize::dynamize] +#[collection(MyCollection, 3)] +trait CustomCollection { + type A: Into<String>; + + fn test(&self) -> MyCollection<Self::A, Self::A, Self::A>; +} |