pub struct StackRef<T>(/* private fields */)
where
T: Stackable;Implementations§
Source§impl<T> StackRef<T>where
T: Stackable,
impl<T> StackRef<T>where
T: Stackable,
pub fn iter(&self) -> Iter<'_, T> ⓘ
pub fn iter_mut(&mut self) -> IterMut<'_, T> ⓘ
Sourcepub fn get(&self, idx: usize) -> Option<&<T as ForeignType>::Ref>
pub fn get(&self, idx: usize) -> Option<&<T as ForeignType>::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 as ForeignType>::Ref>
pub fn get_mut(&mut self, idx: usize) -> Option<&mut <T as ForeignType>::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> ForeignTypeRef for StackRef<T>where
T: Stackable,
impl<T> ForeignTypeRef for StackRef<T>where
T: Stackable,
Source§impl<'a, T> IntoIterator for &'a StackRef<T>where
T: Stackable,
impl<'a, T> IntoIterator for &'a StackRef<T>where
T: Stackable,
Source§impl<'a, T> IntoIterator for &'a mut StackRef<T>where
T: Stackable,
impl<'a, T> IntoIterator for &'a mut StackRef<T>where
T: Stackable,
impl<T> Send for StackRef<T>
impl<T> Sync for StackRef<T>
Auto Trait Implementations§
impl<T> Freeze for StackRef<T>
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