Struct nncombinator::Cons
source · [−]pub struct Cons<R, T>(pub R, pub T)
where
R: Stack;
Expand description
Stack containing elements
Tuple Fields
0: R
1: T
Trait Implementations
sourceimpl<R, T> Stack for Cons<R, T>where
R: Stack,
impl<R, T> Stack for Cons<R, T>where
R: Stack,
type Remaining = R
type Remaining = R
Stack containing elements that do not include the top element of the stack
type Head = T
type Head = T
Top element of the stack
sourcefn 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
sourcefn 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
sourcefn 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<R, T> RefUnwindSafe for Cons<R, T>where
R: RefUnwindSafe,
T: RefUnwindSafe,
impl<R, T> Send for Cons<R, T>where
R: Send,
T: Send,
impl<R, T> Sync for Cons<R, T>where
R: Sync,
T: Sync,
impl<R, T> Unpin for Cons<R, T>where
R: Unpin,
T: Unpin,
impl<R, T> UnwindSafe for Cons<R, T>where
R: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more