pub struct Nil;Expand description
Empty stack, containing no elements
Trait Implementations§
Source§impl Stack for Nil
impl Stack for Nil
Source§type Remaining = Nil
type Remaining = Nil
Stack containing elements that do not include the top element of the stack
Source§fn pop(self) -> (Self::Remaining, Self::Head)
fn pop(self) -> (Self::Remaining, Self::Head)
Returns a tuple of the top item in the stack and the rest of the stack
Source§fn push<H>(self, head: H) -> Cons<Self, H>where
Self: Sized,
fn push<H>(self, head: H) -> Cons<Self, H>where
Self: Sized,
Returns Cons with items pushed to the stack Read more
Source§fn map<F: FnOnce(&Self::Head) -> O, O>(&self, f: F) -> O
fn map<F: FnOnce(&Self::Head) -> O, O>(&self, f: F) -> O
Returns the result of applying the callback function to the top element of the stack Read more
Source§fn map_remaining<F: FnOnce(&Self::Remaining) -> O, O>(&self, f: F) -> O
fn map_remaining<F: FnOnce(&Self::Remaining) -> O, O>(&self, f: F) -> O
Returns the result of applying the callback to a stack that does not contain the top element of the stack Read more
Auto Trait Implementations§
impl Freeze for Nil
impl RefUnwindSafe for Nil
impl Send for Nil
impl Sync for Nil
impl Unpin for Nil
impl UnwindSafe for Nil
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more