pub struct Stack<T: Stackable>(/* private fields */);
Expand description
An owned stack of T
.
Implementations§
Methods from Deref<Target = StackRef<T>>§
pub fn iter(&self) -> Iter<'_, T> ⓘ
pub fn iter_mut(&mut self) -> IterMut<'_, T> ⓘ
Sourcepub fn get(&self, idx: usize) -> Option<&T::Ref>
pub fn get(&self, idx: usize) -> Option<&T::Ref>
Returns a reference to the element at the given index in the
stack or None
if the index is out of bounds
Sourcepub fn get_mut(&mut self, idx: usize) -> Option<&mut T::Ref>
pub fn get_mut(&mut self, idx: usize) -> Option<&mut T::Ref>
Returns a mutable reference to the element at the given index in the
stack or None
if the index is out of bounds
Sourcepub fn push(&mut self, data: T) -> Result<(), ErrorStack>
pub fn push(&mut self, data: T) -> Result<(), ErrorStack>
Pushes a value onto the top of the stack.
Trait Implementations§
Source§impl<T: Stackable> ForeignType for Stack<T>
impl<T: Stackable> ForeignType for Stack<T>
Source§impl<'a, T: Stackable> IntoIterator for &'a Stack<T>
impl<'a, T: Stackable> IntoIterator for &'a Stack<T>
Source§impl<'a, T: Stackable> IntoIterator for &'a mut Stack<T>
impl<'a, T: Stackable> IntoIterator for &'a mut Stack<T>
Source§impl<T: Stackable> IntoIterator for Stack<T>
impl<T: Stackable> IntoIterator for Stack<T>
impl<T: Stackable + Send> Send for Stack<T>
impl<T: Stackable + Sync> Sync for Stack<T>
Auto Trait Implementations§
impl<T> Freeze for Stack<T>
impl<T> RefUnwindSafe for Stack<T>
impl<T> Unpin for Stack<T>
impl<T> UnwindSafe for Stack<T>
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
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 8 bytes