pub enum List<A> {
Nil,
Cons {
head: A,
tail: Rc<List<A>>,
},
}
Variants§
Implementations§
Trait Implementations§
Source§impl<A> Stack<A> for List<A>
impl<A> Stack<A> for List<A>
fn cons(self, value: A) -> Self
fn head(&self) -> Result<&A, StackError>
fn tail(&self) -> Rc<Self>
fn size(&self) -> usize
fn update(self, index: u32, new_value: A) -> Result<Self, StackError>where
Self: Sized,
fn get(&self, index: u32) -> Result<&A, StackError>
impl<A> Applicative for List<A>
impl<A: Eq> Eq for List<A>
impl<A: Clone> Monad for List<A>
impl<A> Monoid for List<A>
impl<A> StructuralPartialEq for List<A>
Auto Trait Implementations§
impl<A> Freeze for List<A>where
A: Freeze,
impl<A> RefUnwindSafe for List<A>where
A: RefUnwindSafe,
impl<A> !Send for List<A>
impl<A> !Sync for List<A>
impl<A> Unpin for List<A>where
A: Unpin,
impl<A> UnwindSafe for List<A>where
A: 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