Struct iodyn::stack::Stack
[−]
[src]
pub struct Stack<T: 'static + Debug + Clone + Eq + Hash>(pub Option<Head<T>>);
Common linked-list
Methods
impl<T: 'static + Debug + Clone + Eq + Hash> Stack<T>
[src]
fn new() -> Self
this is identical to Stack(None)
fn is_empty(&self) -> bool
fn push(&self, name: Option<Name>, elem: T) -> Self
return a stack with the new item as head
fn peek(&self) -> Option<T>
return the top item, if there is one
fn name(&self) -> Option<Name>
get the incremental name of this stack, if it's not empty
fn pull(&self) -> Option<Self>
return the stack without the top item (this is sometimes called tail
)
fn iter(&self) -> Iter<T>
return an iterator over the elements from the top of the stack
Trait Implementations
impl<T: Debug + 'static + Debug + Clone + Eq + Hash> Debug for Stack<T>
[src]
impl<T: PartialEq + 'static + Debug + Clone + Eq + Hash> PartialEq for Stack<T>
[src]
fn eq(&self, __arg_0: &Stack<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Stack<T>) -> bool
This method tests for !=
.
impl<T: Eq + 'static + Debug + Clone + Eq + Hash> Eq for Stack<T>
[src]
impl<T: Clone + 'static + Debug + Clone + Eq + Hash> Clone for Stack<T>
[src]
fn clone(&self) -> Stack<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more