pub struct Stack<T, const N: usize> { /* private fields */ }
Implementations§
Source§impl<T, const N: usize> Stack<T, N>
impl<T, const N: usize> Stack<T, N>
pub const fn new() -> Self
pub fn push(&mut self, item: T) -> Result<(), Error>
pub fn pop(&mut self) -> Option<T>
pub const fn peek(&self) -> Option<&T>
pub fn as_slice(&self) -> &[T]
pub fn as_mut_slice(&mut self) -> &mut [T]
pub const fn capacity(&self) -> usize
pub const fn size(&self) -> usize
pub const fn is_full(&self) -> bool
pub const fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl<T, const N: usize> Freeze for Stack<T, N>where
T: Freeze,
impl<T, const N: usize> RefUnwindSafe for Stack<T, N>where
T: RefUnwindSafe,
impl<T, const N: usize> Send for Stack<T, N>where
T: Send,
impl<T, const N: usize> Sync for Stack<T, N>where
T: Sync,
impl<T, const N: usize> Unpin for Stack<T, N>where
T: Unpin,
impl<T, const N: usize> UnwindSafe for Stack<T, N>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