pub enum OrderedMove {
Prev,
Next,
First,
Last,
}Expand description
Which way a move goes within an ordered collection.
See the module documentation for why the far ends are their own variants rather than a repeated step.
Variants§
Prev
One place earlier in the collection’s order.
Next
One place later.
First
All the way to the first position.
Last
All the way to the last position.
Implementations§
Source§impl OrderedMove
impl OrderedMove
Sourcepub const ALL: [OrderedMove; 4]
pub const ALL: [OrderedMove; 4]
The four moves, in the order they are offered to the user.
Sourcepub fn destination(self, from: usize, count: usize) -> Option<usize>
pub fn destination(self, from: usize, count: usize) -> Option<usize>
Where index from lands in a collection of count items, or None
when the move would change nothing.
A move that changes nothing is not offered: it earns no menu row, no custom action and no announcement. That is what keeps a row already at the top from advertising “Move to top”.
Sourcepub fn as_row_drop(self, from: usize, count: usize) -> Option<RowDrop>
pub fn as_row_drop(self, from: usize, count: usize) -> Option<RowDrop>
The drop a pointer would have made to perform this move, or None when
the move changes nothing.
Sourcepub fn available(from: usize, count: usize) -> Vec<OrderedMove>
pub fn available(from: usize, count: usize) -> Vec<OrderedMove>
The moves available from from in a collection of count.
Sourcepub fn label(self, axis: MoveAxis) -> LocalizedString
pub fn label(self, axis: MoveAxis) -> LocalizedString
What this move is called on the given axis.
Sourcepub fn from_key(
key: Key,
modifiers: Modifiers,
axis: MoveAxis,
rtl: bool,
) -> Option<Self>
pub fn from_key( key: Key, modifiers: Modifiers, axis: MoveAxis, rtl: bool, ) -> Option<Self>
Decode the keyboard chord that performs a move on the given axis.
Alt plus the axis’ own two arrows steps; Alt+Home / Alt+End go to
the ends. Alt is what every outliner and tab strip already uses for
this (and what the three data views that had a keyboard reorder before
this module used), so the chord is not new vocabulary.
rtl swaps the two horizontal arrows, because on the horizontal axis
the arrow keys name a direction on screen while the move names a
position in the order. Home/End are unaffected: they name the order’s
ends, which do not flip.
Trait Implementations§
Source§impl Clone for OrderedMove
impl Clone for OrderedMove
impl Copy for OrderedMove
Source§impl Debug for OrderedMove
impl Debug for OrderedMove
impl Eq for OrderedMove
Source§impl Hash for OrderedMove
impl Hash for OrderedMove
Source§impl PartialEq for OrderedMove
impl PartialEq for OrderedMove
impl StructuralPartialEq for OrderedMove
Auto Trait Implementations§
impl Freeze for OrderedMove
impl RefUnwindSafe for OrderedMove
impl Send for OrderedMove
impl Sync for OrderedMove
impl Unpin for OrderedMove
impl UnsafeUnpin for OrderedMove
impl UnwindSafe for OrderedMove
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more