Struct intrusive_collections::singly_linked_list::Cursor
source · Expand description
A cursor which provides read-only access to a SinglyLinkedList
.
Implementations
sourceimpl<'a, A: Adapter<Link = Link>> Cursor<'a, A>
impl<'a, A: Adapter<Link = Link>> Cursor<'a, A>
sourcepub fn get(&self) -> Option<&'a A::Value>
pub fn get(&self) -> Option<&'a A::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 move_next(&mut self)
pub fn move_next(&mut self)
Moves the cursor to the next element of the SinglyLinkedList
.
If the cursor is pointer to the null object then this will move it to
the first element of the SinglyLinkedList
. If it is pointing to the
last element of the SinglyLinkedList
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 SinglyLinkedList
.
If the cursor is pointer to the null object then this will return the
first element of the SinglyLinkedList
. If it is pointing to the last
element of the SinglyLinkedList
then this will return a null cursor.