[−][src]Struct adt::Stack
A FIFO data structure
Methods
impl<T> Stack<T>
[src]
impl<T> Stack<T>
pub fn new() -> Self | [src] |
Returns a new Stack object
pub fn push(&mut self, value: T) | [src] |
pub fn pop(&mut self) -> Option<T> | [src] |
Pops a value off the Stack and returns it as an Option
pub fn peek(&self) -> Option<&T> | [src] |
Returns an immutable reference to the value on top of the Stack
pub fn peek_mut(&mut self) -> Option<&mut T> | [src] |
Returns a mutable reference to the value on top of the Stack
pub fn size(&self) -> usize | [src] |
Returns the number of items on the Stack
pub fn is_empty(&self) -> bool | [src] |
Returns whether the Stack is empty
pub fn clear(&mut self) | [src] |
Clears the Stack
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> | [src] |
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T | [src] |
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId | [src] |