pub struct SelectionMut<'a, T> { /* private fields */ }Implementations§
Source§impl<'a, T> SelectionMut<'a, T>
impl<'a, T> SelectionMut<'a, T>
Sourcepub fn into_cursor_at_start(self) -> CursorMut<'a, T>
pub fn into_cursor_at_start(self) -> CursorMut<'a, T>
Converts into a cursor at the start of the selection.
Sourcepub fn into_cursor_at_end(self) -> CursorMut<'a, T>
pub fn into_cursor_at_end(self) -> CursorMut<'a, T>
Converts into a cursor at the end of the selection.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn move_start_prev(&mut self) -> bool
pub fn move_start_prev(&mut self) -> bool
Grows the selection backward by one.
Returns false, without moving, if already at the start of the list.
Sourcepub fn move_start_next(&mut self) -> bool
pub fn move_start_next(&mut self) -> bool
Shrinks the selection from the start by one.
Returns false, without moving, if the selection is empty.
Sourcepub fn move_end_prev(&mut self) -> bool
pub fn move_end_prev(&mut self) -> bool
Shrinks the selection from the end by one.
Returns false, without moving, if the selection is empty.
Sourcepub fn move_end_next(&mut self) -> bool
pub fn move_end_next(&mut self) -> bool
Grows the selection forward by one.
Returns false, without moving, if already at the end of the list.
Sourcepub fn absorb_all_before(&mut self)
pub fn absorb_all_before(&mut self)
Grows the selection to the start of the list.
Sourcepub fn absorb_all_after(&mut self)
pub fn absorb_all_after(&mut self)
Grows the selection to the end of the list.
pub fn first_mut(&mut self) -> Option<&mut T>
pub fn last_mut(&mut self) -> Option<&mut T>
Sourcepub fn peek_before_start(&self) -> Option<&T>
pub fn peek_before_start(&self) -> Option<&T>
Returns the element just before the selection.
Sourcepub fn peek_after_end(&self) -> Option<&T>
pub fn peek_after_end(&self) -> Option<&T>
Returns the element just after the selection.
pub fn peek_before_start_mut(&mut self) -> Option<&mut T>
pub fn peek_after_end_mut(&mut self) -> Option<&mut T>
Sourcepub fn insert_before_start(&mut self, value: T)
pub fn insert_before_start(&mut self, value: T)
Inserts an element just before the selection.
Sourcepub fn insert_at_start(&mut self, value: T)
pub fn insert_at_start(&mut self, value: T)
Inserts an element at the start of the selection.
Sourcepub fn insert_at_end(&mut self, value: T)
pub fn insert_at_end(&mut self, value: T)
Inserts an element at the end of the selection.
Sourcepub fn insert_after_end(&mut self, value: T)
pub fn insert_after_end(&mut self, value: T)
Inserts an element just after the selection.
Sourcepub fn remove_before_start(&mut self) -> Option<T>
pub fn remove_before_start(&mut self) -> Option<T>
Removes and returns the element just before the selection.
Sourcepub fn remove_first(&mut self) -> Option<T>
pub fn remove_first(&mut self) -> Option<T>
Removes and returns the first selected element.
Sourcepub fn remove_last(&mut self) -> Option<T>
pub fn remove_last(&mut self) -> Option<T>
Removes and returns the last selected element.
Sourcepub fn remove_after_end(&mut self) -> Option<T>
pub fn remove_after_end(&mut self) -> Option<T>
Removes and returns the element just after the selection.
Sourcepub fn take(&mut self) -> LinkedList<T>
pub fn take(&mut self) -> LinkedList<T>
Removes and returns the selected elements, leaving the selection empty.
Sourcepub fn replace(&mut self, other: LinkedList<T>) -> LinkedList<T>
pub fn replace(&mut self, other: LinkedList<T>) -> LinkedList<T>
Replaces the selected elements with other.
Afterwards, the selection covers exactly the elements from other.
Returns the previously selected elements.
Sourcepub fn iter(&self) -> impl DoubleEndedIterator<Item = &T> + ExactSizeIterator
pub fn iter(&self) -> impl DoubleEndedIterator<Item = &T> + ExactSizeIterator
Iterates over the selected elements.