Struct intrusive_collections::linked_list::CursorOwning
source · pub struct CursorOwning<A: Adapter>where
A::LinkOps: LinkedListOps,{ /* private fields */ }
Expand description
A cursor with ownership over the LinkedList
it points into.
Implementations§
source§impl<A: Adapter> CursorOwning<A>where
A::LinkOps: LinkedListOps,
impl<A: Adapter> CursorOwning<A>where
A::LinkOps: LinkedListOps,
sourcepub fn into_inner(self) -> LinkedList<A>
pub fn into_inner(self) -> LinkedList<A>
Consumes self and returns the inner LinkedList
.
sourcepub fn as_cursor(&self) -> Cursor<'_, A>
pub fn as_cursor(&self) -> Cursor<'_, A>
Returns a read-only cursor pointing to the current element.
The lifetime of the returned Cursor
is bound to that of the
CursorOwning
, which means it cannot outlive the CursorOwning
and that the
CursorOwning
is frozen for the lifetime of the Cursor
.
Mutations of the returned cursor are not reflected in the original.
sourcepub fn with_cursor_mut<T>(
&mut self,
f: impl FnOnce(&mut CursorMut<'_, A>) -> T,
) -> T
pub fn with_cursor_mut<T>( &mut self, f: impl FnOnce(&mut CursorMut<'_, A>) -> T, ) -> T
Perform action with mutable reference to the cursor.
All mutations of the cursor are reflected in the original.
Trait Implementations§
impl<A: Adapter> Send for CursorOwning<A>
Auto Trait Implementations§
impl<A> Freeze for CursorOwning<A>
impl<A> RefUnwindSafe for CursorOwning<A>
impl<A> Sync for CursorOwning<A>
impl<A> Unpin for CursorOwning<A>
impl<A> UnwindSafe for CursorOwning<A>
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