Struct Selection

Source
pub struct Selection<P, C: SelectionSet> {
    pub selected: C,
    pub grab: Option<GrabInfo<P, C::Index>>,
}

Fields§

§selected: C§grab: Option<GrabInfo<P, C::Index>>

Implementations§

Source§

impl<P: Copy, C: SelectionSet> Selection<P, C>
where C::Index: Copy,

Source

pub fn new(selected: C) -> Self

Source

pub fn press<S: Selector<Position = P>>( &mut self, pos: P, cursor: P, selector: &S, selectable: &S::Selectable, )
where S::Selectable: Selectable<Index = C::Index>,

Source

pub fn release<S: Selector<Position = P>>( &mut self, pos: P, selector: &S, selectable: &mut S::Selectable, )
where S::Selectable: Selectable<Index = C::Index>,

Source

pub fn on_moved<S: Selector<Position = P>>(&mut self, cursor: P, selector: &S)

Source§

impl<P, S: SelectionSet> Selection<P, S>

Source

pub fn iter<'a>(&'a self) -> <&'a S as IntoIterator>::IntoIter

Trait Implementations§

Source§

impl<P: Default, C: Default + SelectionSet> Default for Selection<P, C>
where C::Index: Default,

Source§

fn default() -> Selection<P, C>

Returns the “default value” for a type. Read more
Source§

impl<'a, P, S: SelectionSet> IntoIterator for &'a Selection<P, S>

Source§

type Item = <&'a S as IntoIterator>::Item

The type of the elements being iterated over.
Source§

type IntoIter = <&'a S as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<P, S: SelectionSet + IntoIterator> IntoIterator for Selection<P, S>

Source§

type Item = <S as IntoIterator>::Item

The type of the elements being iterated over.
Source§

type IntoIter = <S as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<P, C> Freeze for Selection<P, C>
where C: Freeze, P: Freeze, <C as SelectionSet>::Index: Freeze,

§

impl<P, C> RefUnwindSafe for Selection<P, C>

§

impl<P, C> Send for Selection<P, C>
where C: Send, P: Send, <C as SelectionSet>::Index: Send,

§

impl<P, C> Sync for Selection<P, C>
where C: Sync, P: Sync, <C as SelectionSet>::Index: Sync,

§

impl<P, C> Unpin for Selection<P, C>
where C: Unpin, P: Unpin, <C as SelectionSet>::Index: Unpin,

§

impl<P, C> UnwindSafe for Selection<P, C>

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.