Trait Selector

Source
pub trait Selector {
    type Selectable: Selectable<Position = Self::Position>;
    type Position: Copy;

    // Required methods
    fn moved(&self, moved: Self::Position, cursor: Self::Position) -> bool;
    fn stop(
        &self,
        selectable: &mut Self::Selectable,
        index: <Self::Selectable as Selectable>::Index,
    );

    // Provided methods
    fn add(
        &self,
        selectable: &mut Self::Selectable,
        pos: Self::Position,
        from: Option<<Self::Selectable as Selectable>::Index>,
    ) -> <Self::Selectable as Selectable>::Index { ... }
    fn get(
        &self,
        selectable: &Self::Selectable,
        pos: Self::Position,
    ) -> Option<<Self::Selectable as Selectable>::Index> { ... }
    fn connect(
        &self,
        selectable: &mut Self::Selectable,
        index: <Self::Selectable as Selectable>::Index,
        selected: &[<Self::Selectable as Selectable>::Index],
    ) { ... }
    fn special(
        &self,
        selectable: &mut Self::Selectable,
        index: <Self::Selectable as Selectable>::Index,
        selected: &[<Self::Selectable as Selectable>::Index],
    ) { ... }
}

Required Associated Types§

Required Methods§

Source

fn moved(&self, moved: Self::Position, cursor: Self::Position) -> bool

Source

fn stop( &self, selectable: &mut Self::Selectable, index: <Self::Selectable as Selectable>::Index, )

Provided Methods§

Source

fn add( &self, selectable: &mut Self::Selectable, pos: Self::Position, from: Option<<Self::Selectable as Selectable>::Index>, ) -> <Self::Selectable as Selectable>::Index

Source

fn get( &self, selectable: &Self::Selectable, pos: Self::Position, ) -> Option<<Self::Selectable as Selectable>::Index>

Source

fn connect( &self, selectable: &mut Self::Selectable, index: <Self::Selectable as Selectable>::Index, selected: &[<Self::Selectable as Selectable>::Index], )

Source

fn special( &self, selectable: &mut Self::Selectable, index: <Self::Selectable as Selectable>::Index, selected: &[<Self::Selectable as Selectable>::Index], )

Implementors§