pub struct Stack<T> { /* private fields */ }
Expand description
§Stack enforced and size limited vector
Implementations§
Source§impl<T> Stack<T>
impl<T> Stack<T>
pub fn new(overflow_message: &'static str) -> Stack<T>
pub fn get_mut(&mut self, index: usize) -> Option<&mut T>
pub fn clear(&mut self)
pub fn drain<R>(&mut self, range: R) -> Drain<'_, T>where
R: RangeBounds<usize>,
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn is_full(&self) -> bool
pub fn last(&self) -> Option<&T>
pub fn get(&self, index: usize) -> Option<&T>
pub fn append(&mut self, other: &mut Stack<T>) -> Result<(), Error>
pub fn push(&mut self, val: T) -> Result<(), Error>
pub fn pop(&mut self) -> Result<T, Error>
pub fn pop_2(&mut self) -> Result<(T, T), Error>
pub fn pop_n(&mut self, len: usize) -> Result<Stack<T>, Error>
Trait Implementations§
Source§impl<T> IntoIterator for Stack<T>
impl<T> IntoIterator for Stack<T>
Auto Trait Implementations§
impl<T> Freeze for Stack<T>
impl<T> RefUnwindSafe for Stack<T>where
T: RefUnwindSafe,
impl<T> Send for Stack<T>where
T: Send,
impl<T> Sync for Stack<T>where
T: Sync,
impl<T> Unpin for Stack<T>where
T: Unpin,
impl<T> UnwindSafe for Stack<T>where
T: UnwindSafe,
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