pub enum List<'t, T> {
Pair(T, &'t List<'t, T>),
Null,
}Expand description
Cons list. Only works with normal references. That’s because making it generic for the reference/container type appears unworkable, even though feasible in principle, due to requiring explicit type parameters on every single cons call. The solution will be to generate the code for versions using Rc, Arc or whatever when needed. (Or, use dyn?, or perhaps/probably rather, enum.)
Variants§
Implementations§
Auto Trait Implementations§
impl<'t, T> Freeze for List<'t, T>where
T: Freeze,
impl<'t, T> RefUnwindSafe for List<'t, T>where
T: RefUnwindSafe,
impl<'t, T> Send for List<'t, T>
impl<'t, T> Sync for List<'t, T>where
T: Sync,
impl<'t, T> Unpin for List<'t, T>where
T: Unpin,
impl<'t, T> UnwindSafe for List<'t, T>where
T: UnwindSafe + RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more