pub struct StackRef<T: Stackable>(_, _);
Implementations
sourceimpl<T: Stackable> StackRef<T>
impl<T: Stackable> StackRef<T>
pub fn iter(&self) -> Iter<'_, T>ⓘNotable traits for Iter<'a, T>impl<'a, T: Stackable> Iterator for Iter<'a, T> type Item = &'a T::Ref;
pub fn iter_mut(&mut self) -> IterMut<'_, T>ⓘNotable traits for IterMut<'a, T>impl<'a, T: Stackable> Iterator for IterMut<'a, T> type Item = &'a mut T::Ref;
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
sourceimpl<T: Stackable> ForeignTypeRef for StackRef<T>
impl<T: Stackable> ForeignTypeRef for StackRef<T>
sourceimpl<'a, T: Stackable> IntoIterator for &'a StackRef<T>
impl<'a, T: Stackable> IntoIterator for &'a StackRef<T>
type Item = &'a <T as ForeignType>::Ref
type Item = &'a <T as ForeignType>::Ref
The type of the elements being iterated over.
sourceimpl<'a, T: Stackable> IntoIterator for &'a mut StackRef<T>
impl<'a, T: Stackable> IntoIterator for &'a mut StackRef<T>
type Item = &'a mut <T as ForeignType>::Ref
type Item = &'a mut <T as ForeignType>::Ref
The type of the elements being iterated over.
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more