pub struct CursorMut<'a, T> { /* private fields */ }
Expand description
A cursor which can read and write the elements of the list.
Returns a mutable reference to the element at the cursor’s current
position.
Inserts a new element at the cursor’s current position. The cursor
will be moved to the new element. Returns the handle of the new
element.
Inserts a new element after the cursor’s current position. The cursor
will still be at the same position. Returns the handle of the new
element.
Removes the element at the current position and returns its value. The
cursor will be moved to the next element if not at the end of the
vector, otherwise it moves to the new end. If there was only one item
in the vector, the cursor’s position is set to BAD_HANDLE and should
no longer be used, or could cause invalid handle panics.
Returns a reference to the element at the cursor’s current position.
Returns the handle of the element at the cursor’s current position.
Moves the cursor to the specified handle. Returns true if the cursor
was moved, false if the handle was invalid.
Moves the cursor to the next element. Returns the handle of the next
element if the cursor was moved, None if the cursor was already at the
end of the list.
Moves the cursor to the previous element. Returns the handle of the
previous element if the cursor was moved, None if the cursor was
already at the start of the list.
Moves the cursor to the start of the list. Returns the handle of the
first element if the cursor was moved, None if the list is empty.
Moves the cursor to the end of the list. Returns the handle of the
last element if the cursor was moved, None if the list is empty.
👎Deprecated since 1.1.0: Use move_to_front() instead.
Moves the cursor to the start of the list. Returns the handle of the
first element if the cursor was moved, None if the list is empty.
👎Deprecated since 1.1.0: Use move_to_back() instead.
Moves the cursor to the end of the list. Returns the handle of the
last element if the cursor was moved, None if the list is empty.
Moves the cursor forward by the specified number of elements. Returns
the handle of the element at the new position if the cursor was moved,
Err(handle) if the cursor was already at the end of the list.
Moves the cursor backward by the specified number of elements. Returns
the handle of the element at the new position if the cursor was moved,
Err(handle) if the cursor was already at the start of the list.
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.