pub enum StateMut<'a, T> {
Empty,
Head,
Tail,
Node(&'a mut T),
}
Expand description
An enum to represent the state of a Cursor
while allowing for mutation.
Variants§
Empty
The cursor holds an empty list and therefore doesn’t point anywhere.
Head
The cursor is pointing to the ‘ghost’ element before the start of a list.
Tail
The cursor is pointing to the ‘ghost’ element after the end of a list.
Node(&'a mut T)
The cursor is pointing to a Node within the list, containing the mutably borrowed value.
Implementations§
Source§impl<'a, T> StateMut<'a, T>
impl<'a, T> StateMut<'a, T>
Sourcepub const fn is_empty(&self) -> bool
pub const fn is_empty(&self) -> bool
Returns true
if this value is of type Empty
. Returns false
otherwise
Sourcepub const fn is_head(&self) -> bool
pub const fn is_head(&self) -> bool
Returns true
if this value is of type Head
. Returns false
otherwise
Trait Implementations§
impl<'a, T: Eq> Eq for StateMut<'a, T>
impl<'a, T> StructuralPartialEq for StateMut<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for StateMut<'a, T>
impl<'a, T> RefUnwindSafe for StateMut<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for StateMut<'a, T>where
T: Send,
impl<'a, T> Sync for StateMut<'a, T>where
T: Sync,
impl<'a, T> Unpin for StateMut<'a, T>
impl<'a, T> !UnwindSafe for StateMut<'a, 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