Skip to main content

SelectionMut

Struct SelectionMut 

Source
pub struct SelectionMut<'a, T> { /* private fields */ }

Implementations§

Source§

impl<'a, T> SelectionMut<'a, T>

Source

pub fn into_cursor_at_start(self) -> CursorMut<'a, T>

Converts into a cursor at the start of the selection.

Source

pub fn into_cursor_at_end(self) -> CursorMut<'a, T>

Converts into a cursor at the end of the selection.

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn absorb_all_before(&mut self)

Grows the selection to the start of the list.

Source

pub fn absorb_all_after(&mut self)

Grows the selection to the end of the list.

Source

pub fn first(&self) -> Option<&T>

Returns the first selected element.

Source

pub fn last(&self) -> Option<&T>

Returns the last selected element.

Source

pub fn first_mut(&mut self) -> Option<&mut T>

Source

pub fn last_mut(&mut self) -> Option<&mut T>

Source

pub fn peek_before_start(&self) -> Option<&T>

Returns the element just before the selection.

Source

pub fn peek_after_end(&self) -> Option<&T>

Returns the element just after the selection.

Source

pub fn peek_before_start_mut(&mut self) -> Option<&mut T>

Source

pub fn peek_after_end_mut(&mut self) -> Option<&mut T>

Source

pub fn insert_before_start(&mut self, value: T)

Inserts an element just before the selection.

Source

pub fn insert_at_start(&mut self, value: T)

Inserts an element at the start of the selection.

Source

pub fn insert_at_end(&mut self, value: T)

Inserts an element at the end of the selection.

Source

pub fn insert_after_end(&mut self, value: T)

Inserts an element just after the selection.

Source

pub fn remove_before_start(&mut self) -> Option<T>

Removes and returns the element just before the selection.

Source

pub fn remove_first(&mut self) -> Option<T>

Removes and returns the first selected element.

Source

pub fn remove_last(&mut self) -> Option<T>

Removes and returns the last selected element.

Source

pub fn remove_after_end(&mut self) -> Option<T>

Removes and returns the element just after the selection.

Source

pub fn take(&mut self) -> LinkedList<T>

Removes and returns the selected elements, leaving the selection empty.

Source

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.

Source

pub fn iter(&self) -> impl DoubleEndedIterator<Item = &T> + ExactSizeIterator

Iterates over the selected elements.

Source

pub fn iter_mut( &mut self, ) -> impl DoubleEndedIterator<Item = &mut T> + ExactSizeIterator

Auto Trait Implementations§

§

impl<'a, T> !UnwindSafe for SelectionMut<'a, T>

§

impl<'a, T> Freeze for SelectionMut<'a, T>
where &'a mut LinkedList<T>: Freeze,

§

impl<'a, T> RefUnwindSafe for SelectionMut<'a, T>
where &'a mut LinkedList<T>: RefUnwindSafe,

§

impl<'a, T> Send for SelectionMut<'a, T>
where &'a mut LinkedList<T>: Send,

§

impl<'a, T> Sync for SelectionMut<'a, T>
where &'a mut LinkedList<T>: Sync,

§

impl<'a, T> Unpin for SelectionMut<'a, T>
where &'a mut LinkedList<T>: Unpin,

§

impl<'a, T> UnsafeUnpin for SelectionMut<'a, T>
where &'a mut LinkedList<T>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.