Enum TextMovement

Source
pub enum TextMovement {
    Left,
    Right,
    WordLeft,
    WordRight,
    LineStart,
    LineEnd,
    DocumentStart,
    DocumentEnd,
    LineUp,
    LineDown,
    PageUp,
    PageDown,
}
Expand description

Caret movement direction for keyboard navigation.

Horizontal character movement follows Unicode extended grapheme clusters. Words are whitespace-delimited; punctuation remains part of a word. Vertical movement uses newline-delimited logical lines and preserves a grapheme column, not shaped X geometry. Page movement is exactly ten logical lines.

§Examples

use ailloli_ui_text::TextMovement;
assert_ne!(TextMovement::Left, TextMovement::WordLeft);
assert_ne!(TextMovement::LineUp, TextMovement::PageUp);

Variants§

§

Left

Move to the previous extended grapheme boundary.

§

Right

Move to the next extended grapheme boundary.

§

WordLeft

Move left across whitespace and then to the current word’s start.

§

WordRight

Move right across whitespace and through the next non-whitespace run.

§

LineStart

Move after the previous newline, or byte zero on the first line.

§

LineEnd

Move before the next newline, or to document end on the last line.

§

DocumentStart

Move to UTF-8 byte zero.

§

DocumentEnd

Move to the document’s UTF-8 byte length.

§

LineUp

Move one logical line up at the same grapheme column when possible.

§

LineDown

Move one logical line down at the same grapheme column when possible.

§

PageUp

Move ten logical lines up at the same grapheme column when possible.

§

PageDown

Move ten logical lines down at the same grapheme column when possible.

Trait Implementations§

Source§

impl Clone for TextMovement

Source§

fn clone(&self) -> TextMovement

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TextMovement

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for TextMovement

Source§

fn eq(&self, other: &TextMovement) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for TextMovement

Source§

impl Eq for TextMovement

Source§

impl StructuralPartialEq for TextMovement

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
§

impl<T> ErasedDestructor for T
where T: 'static,