pub struct StackRef<T: Stackable>(/* private fields */);
Implementations§
source§impl<T: Stackable> StackRef<T>
impl<T: Stackable> 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> ForeignTypeRef for StackRef<T>
impl<T: Stackable> ForeignTypeRef for StackRef<T>
source§impl<'a, T: Stackable> IntoIterator for &'a StackRef<T>
impl<'a, T: Stackable> IntoIterator for &'a StackRef<T>
source§impl<'a, T: Stackable> IntoIterator for &'a mut StackRef<T>
impl<'a, T: Stackable> IntoIterator for &'a mut StackRef<T>
impl<T: Stackable + Send> Send for StackRef<T>
impl<T: Stackable + Sync> Sync for StackRef<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for StackRef<T>
impl<T> Unpin for StackRef<T>where T: Unpin,
impl<T> UnwindSafe for StackRef<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