list_fn/
empty.rs

1use super::*;
2use core::marker::PhantomData;
3
4pub struct Empty<T, E>(E, PhantomData<T>);
5
6impl<T, E> ListFn for Empty<T, E> {
7    type Item = T;
8    type End = E;
9    fn next(self) -> ListState<Self> {
10        ListState::End(self.0)
11    }
12}
13
14impl<T, E> Empty<T, E> {
15    pub fn new(e: E) -> Self {
16        Empty(e, PhantomData::default())
17    }
18}