Struct intrusive_collections::xor_linked_list::Cursor
source · pub struct Cursor<'a, A: Adapter>where
A::LinkOps: XorLinkedListOps,{ /* private fields */ }
Expand description
A cursor which provides read-only access to a XorLinkedList
.
Implementations§
source§impl<'a, A: Adapter> Cursor<'a, A>where
A::LinkOps: XorLinkedListOps,
impl<'a, A: Adapter> Cursor<'a, A>where
A::LinkOps: XorLinkedListOps,
sourcepub fn get(&self) -> Option<&'a <A::PointerOps as PointerOps>::Value>
pub fn get(&self) -> Option<&'a <A::PointerOps as PointerOps>::Value>
Returns a reference to the object that the cursor is currently pointing to.
This returns None
if the cursor is currently pointing to the null
object.
sourcepub fn clone_pointer(&self) -> Option<<A::PointerOps as PointerOps>::Pointer>
pub fn clone_pointer(&self) -> Option<<A::PointerOps as PointerOps>::Pointer>
Clones and returns the pointer that points to the element that the cursor is referencing.
This returns None
if the cursor is currently pointing to the null
object.
sourcepub fn move_next(&mut self)
pub fn move_next(&mut self)
Moves the cursor to the next element of the XorLinkedList
.
If the cursor is pointer to the null object then this will move it to
the first element of the XorLinkedList
. If it is pointing to the
last element of the XorLinkedList
then this will move it to the
null object.
sourcepub fn move_prev(&mut self)
pub fn move_prev(&mut self)
Moves the cursor to the previous element of the XorLinkedList
.
If the cursor is pointer to the null object then this will move it to
the last element of the XorLinkedList
. If it is pointing to the first
element of the XorLinkedList
then this will move it to the null object.
sourcepub fn peek_next(&self) -> Cursor<'_, A>
pub fn peek_next(&self) -> Cursor<'_, A>
Returns a cursor pointing to the next element of the XorLinkedList
.
If the cursor is pointer to the null object then this will return the
first element of the XorLinkedList
. If it is pointing to the last
element of the XorLinkedList
then this will return a null cursor.
sourcepub fn peek_prev(&self) -> Cursor<'_, A>
pub fn peek_prev(&self) -> Cursor<'_, A>
Returns a cursor pointing to the previous element of the XorLinkedList
.
If the cursor is pointer to the null object then this will return the
last element of the XorLinkedList
. If it is pointing to the first
element of the XorLinkedList
then this will return a null cursor.
Trait Implementations§
Auto Trait Implementations§
impl<'a, A> Freeze for Cursor<'a, A>
impl<'a, A> RefUnwindSafe for Cursor<'a, A>
impl<'a, A> Send for Cursor<'a, A>
impl<'a, A> Sync for Cursor<'a, A>
impl<'a, A> Unpin for Cursor<'a, A>
impl<'a, A> UnwindSafe for Cursor<'a, 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)