pub struct Cursor<'list, T: ?Sized + Types> { /* private fields */ }Expand description
A shared cursor into a linked list.
This can be created by methods like PinList::cursor_ghost.
Each cursor conceptually points to a single item in the list. It can also point to the space between the start and end of the list, in which case it is called the ghost cursor.
This type is not Copy to prevent accidental copies, but its Clone implementation is just a
bitwise copy — very cheap.
Implementations§
Source§impl<'list, T: ?Sized + Types> Cursor<'list, T>
impl<'list, T: ?Sized + Types> Cursor<'list, T>
Sourcepub fn move_previous(&mut self)
pub fn move_previous(&mut self)
Move the cursor to the previous element in the linked list.
Sourcepub fn list(&self) -> &'list PinList<T>
pub fn list(&self) -> &'list PinList<T>
Retrieve a shared reference to the list this cursor uses.
Sourcepub fn protected(&self) -> Option<&'list T::Protected>
pub fn protected(&self) -> Option<&'list T::Protected>
Retrieve a shared reference to the protected data of this linked list node.
Returns None if the cursor is the ghost cursor.
Sourcepub fn unprotected(&self) -> Option<&'list T::Unprotected>
pub fn unprotected(&self) -> Option<&'list T::Unprotected>
Retrieve a shared reference to the unprotected data of this linked list node.
Returns None if the cursor is the ghost cursor.
Trait Implementations§
impl<T: ?Sized + Types> Send for Cursor<'_, T>
impl<T: ?Sized + Types> Sync for Cursor<'_, T>
Auto Trait Implementations§
impl<'list, T> Freeze for Cursor<'list, T>where
T: ?Sized,
impl<'list, T> !RefUnwindSafe for Cursor<'list, T>
impl<'list, T> Unpin for Cursor<'list, T>where
T: ?Sized,
impl<'list, T> !UnwindSafe for Cursor<'list, T>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)