[][src]Trait druid::text::EditableTextCursor

pub trait EditableTextCursor<EditableText> {
    pub fn set(&mut self, position: usize);
pub fn pos(&self) -> usize;
pub fn is_boundary(&self) -> bool;
pub fn prev(&mut self) -> Option<usize>;
pub fn next(&mut self) -> Option<usize>;
pub fn peek_next_codepoint(&self) -> Option<char>;
pub fn prev_codepoint(&mut self) -> Option<char>;
pub fn next_codepoint(&mut self) -> Option<char>;
pub fn at_or_next(&mut self) -> Option<usize>;
pub fn at_or_prev(&mut self) -> Option<usize>; }

A cursor with convenience functions for moving through EditableText.

Required methods

pub fn set(&mut self, position: usize)[src]

Set cursor position.

pub fn pos(&self) -> usize[src]

Get cursor position.

pub fn is_boundary(&self) -> bool[src]

Check if cursor position is at a codepoint boundary.

pub fn prev(&mut self) -> Option<usize>[src]

Move cursor to previous codepoint boundary, if it exists. Returns previous codepoint as usize offset.

pub fn next(&mut self) -> Option<usize>[src]

Move cursor to next codepoint boundary, if it exists. Returns current codepoint as usize offset.

pub fn peek_next_codepoint(&self) -> Option<char>[src]

Get the next codepoint after the cursor position, without advancing the cursor.

pub fn prev_codepoint(&mut self) -> Option<char>[src]

Return codepoint preceding cursor offset and move cursor backward.

pub fn next_codepoint(&mut self) -> Option<char>[src]

Return codepoint at cursor offset and move cursor forward.

pub fn at_or_next(&mut self) -> Option<usize>[src]

Return current offset if it's a boundary, else next.

pub fn at_or_prev(&mut self) -> Option<usize>[src]

Return current offset if it's a boundary, else previous.

Loading content...

Implementors

impl<'a> EditableTextCursor<&'a String> for StringCursor<'a>[src]

Loading content...