pub struct InputCore { /* private fields */ }Expand description
Text editing core.
Implementations§
source§impl InputCore
impl InputCore
sourcepub fn set_offset(&mut self, offset: usize)
pub fn set_offset(&mut self, offset: usize)
Change the offset
sourcepub fn set_cursor(&mut self, cursor: usize, extend_selection: bool)
pub fn set_cursor(&mut self, cursor: usize, extend_selection: bool)
Cursor position as grapheme-idx. Moves the cursor to the new position, but can leave the current cursor position as anchor of the selection.
sourcepub fn set_value<S: Into<String>>(&mut self, s: S)
pub fn set_value<S: Into<String>>(&mut self, s: S)
Set the value. Resets cursor and anchor to 0.
sourcepub fn has_selection(&self) -> bool
pub fn has_selection(&self) -> bool
Anchor is active
sourcepub fn next_word_boundary(&self) -> usize
pub fn next_word_boundary(&self) -> usize
Find next word.
sourcepub fn prev_word_boundary(&self) -> usize
pub fn prev_word_boundary(&self) -> usize
Find previous word.
sourcepub fn insert_char(&mut self, new: char)
pub fn insert_char(&mut self, new: char)
Insert a char, replacing the selection.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InputCore
impl RefUnwindSafe for InputCore
impl Send for InputCore
impl Sync for InputCore
impl Unpin for InputCore
impl UnwindSafe for InputCore
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
Mutably borrows from an owned value. Read more