rspace_traits/container.rs
1/*
2 Appellation: store <module>
3 Created At: 2025.12.26:14:12:46
4 Contrib: @FL03
5*/
6use crate::space::RawSpace;
7
8/// The [`Container`] trait is a higher-kinded trait used to establish an interface for
9/// defining containers themselves.
10pub trait Container<U>
11where
12 Self::Cont<U>: RawSpace<Elem = U>,
13{
14 type Cont<V>: ?Sized;
15}
16
17pub trait ContainerIter<U>: Container<U>
18where
19 Self::Cont<U>: RawSpace<Elem = U>,
20{
21 type Iter<'a, T>: Iterator<Item = &'a T>
22 where
23 Self: 'a,
24 T: 'a;
25}
26
27/*
28 ************* Implementations *************
29*/
30impl<S, T> Container<T> for S
31where
32 S: RawSpace<Elem = T>,
33{
34 type Cont<V> = S;
35}