pub struct Stack<T: Copy> {
top: *mut T,
cur: *mut T,
bot: *mut T,
}
Fields§
§top: *mut T
§cur: *mut T
§bot: *mut T
Implementations§
source§impl<T: Copy> Stack<T>
impl<T: Copy> Stack<T>
pub fn new(bottom: *mut T, items: usize) -> Self
pub fn push(&mut self, item: T) -> Result<(), StackError>
pub fn depth(&self) -> usize
pub fn try_pop(&mut self) -> Result<T, StackError>
pub fn pop(&mut self) -> Option<T>
pub fn try_peek(&self) -> Result<T, StackError>
pub fn peek(&self) -> Option<T>
pub fn peek_mut(&mut self) -> Option<&mut T>
pub fn peek_back_n(&self, n: usize) -> Option<T>
pub fn try_peek_back_n(&self, n: usize) -> Result<T, StackError>
pub fn peek_back_n_mut(&mut self, n: usize) -> Option<&mut T>
pub fn try_peek_back_n_mut(&mut self, n: usize) -> Result<&mut T, StackError>
pub fn overwrite_back_n(&mut self, n: usize, item: T) -> Result<(), StackError>
pub fn clear(&mut self)
pub fn is_empty(&self) -> bool
Auto Trait Implementations§
impl<T> Freeze for Stack<T>
impl<T> RefUnwindSafe for Stack<T>where
T: RefUnwindSafe,
impl<T> !Send for Stack<T>
impl<T> !Sync for Stack<T>
impl<T> Unpin for Stack<T>
impl<T> UnwindSafe for Stack<T>where
T: RefUnwindSafe,
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