rspace_traits/
container.rs1use crate::{Apply, RawSpace};
7
8pub trait Container<U>
11where
12 Self::Cont<U>: RawSpace<Elem = U>,
13{
14 type Cont<V>: ?Sized;
15}
16
17pub trait ContainerMap<T>: Container<T>
18where
19 Self::Cont<T>: RawSpace<Elem = T>,
20{
21 fn map<F, X>(&self, f: F) -> Self::Cont<X>
22 where
23 Self::Cont<T>: Apply<F, Output = Self::Cont<X>>,
24 Self::Cont<X>: Sized;
25}
26
27pub trait ContainerIter<U>: Container<U>
30where
31 Self::Cont<U>: RawSpace<Elem = U>,
32{
33 type Iter<'a, T>: Iterator<Item = &'a T>
34 where
35 Self: 'a,
36 T: 'a;
37
38 fn iter(&self) -> Self::Iter<'_, U>;
39}