pub struct Cursor<'a, T, Typ>{ /* private fields */ }Expand description
Cursor into a DynList.
The cursor has a different API than the iterator, and only lends out elements. In exchange, it has operations that can remove elements from the list.
Implementations§
Source§impl<'a, T, Typ> Cursor<'a, T, Typ>
impl<'a, T, Typ> Cursor<'a, T, Typ>
Sourcepub fn current(&mut self) -> &mut T
pub fn current(&mut self) -> &mut T
Gets the current element that the cursor is at.
The element’s lifetime is tied to the cursor rather than the list.
Sourcepub fn move_next(&mut self) -> bool
pub fn move_next(&mut self) -> bool
Move to the next element.
If this returns true, the cursor has been moved. If false, the cursor is already at the last element and the cursor was not moved.
Sourcepub fn drop_after(self)
pub fn drop_after(self)
Drops all elements from the cursor’s current position to the end of the list.
Includes the element that the cursor is on.
Auto Trait Implementations§
impl<'a, T, Typ> !UnwindSafe for Cursor<'a, T, Typ>
impl<'a, T, Typ> Freeze for Cursor<'a, T, Typ>
impl<'a, T, Typ> RefUnwindSafe for Cursor<'a, T, Typ>
impl<'a, T, Typ> Send for Cursor<'a, T, Typ>
impl<'a, T, Typ> Sync for Cursor<'a, T, Typ>
impl<'a, T, Typ> Unpin for Cursor<'a, T, Typ>
impl<'a, T, Typ> UnsafeUnpin for Cursor<'a, T, Typ>
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