dynamic_list/
traits.rs

1use crate::Empty;
2
3pub trait NotEmpty {}
4
5pub trait Length {
6    const SIZE: usize = 0;
7
8    fn len(&self) -> usize {
9        Self::SIZE
10    }
11
12    fn is_empty(&self) -> bool {
13        Self::SIZE == 0
14    }
15}
16impl Length for Empty {}
17
18pub trait Index<I> {
19    type Output<'a>
20    where
21        Self: 'a;
22
23    fn index(&self) -> Self::Output<'_>;
24}