pub struct ArrayStack<T> { /* private fields */ }Expand description
A stack with a fixed maximum capacity.
Implementations§
Source§impl<T: Clone> ArrayStack<T>
impl<T: Clone> ArrayStack<T>
pub fn new(capacity: usize) -> Self
pub fn push(&mut self, val: T) -> bool
pub fn pop(&mut self) -> Option<T>
pub fn peek(&self) -> Option<&T>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn is_full(&self) -> bool
pub fn capacity(&self) -> usize
pub fn clear(&mut self)
pub fn remaining(&self) -> usize
pub fn as_slice(&self) -> &[T]
Trait Implementations§
Source§impl<T: Clone> Clone for ArrayStack<T>
impl<T: Clone> Clone for ArrayStack<T>
Source§fn clone(&self) -> ArrayStack<T>
fn clone(&self) -> ArrayStack<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> Freeze for ArrayStack<T>
impl<T> RefUnwindSafe for ArrayStack<T>where
T: RefUnwindSafe,
impl<T> Send for ArrayStack<T>where
T: Send,
impl<T> Sync for ArrayStack<T>where
T: Sync,
impl<T> Unpin for ArrayStack<T>where
T: Unpin,
impl<T> UnsafeUnpin for ArrayStack<T>
impl<T> UnwindSafe for ArrayStack<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