[][src]Enum liner::CursorPosition

pub enum CursorPosition {
    InWord(usize),
    OnWordLeftEdge(usize),
    OnWordRightEdge(usize),
    InSpace(Option<usize>, Option<usize>),
}

Represents the position of the cursor relative to words in the buffer.

Variants

InWord(usize)

The cursor is in the word with the specified index.

OnWordLeftEdge(usize)

The cursor is on the left edge of the word with the specified index. For example: abc |hi, where | is the cursor.

OnWordRightEdge(usize)

The cursor is on the right edge of the word with the specified index. For example: abc| hi, where | is the cursor.

InSpace(Option<usize>, Option<usize>)

The cursor is not in contact with any word. Each Option<usize> specifies the index of the closest word to the left and right, respectively, or None if there is no word on that side.

Methods

impl CursorPosition[src]

pub fn get(cursor: usize, words: &[(usize, usize)]) -> CursorPosition[src]

Trait Implementations

impl Clone for CursorPosition[src]

impl Copy for CursorPosition[src]

impl Eq for CursorPosition[src]

impl PartialEq<CursorPosition> for CursorPosition[src]

impl Debug for CursorPosition[src]

impl StructuralPartialEq for CursorPosition[src]

impl StructuralEq for CursorPosition[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]