pub struct InputUI {
pub cursor: usize,
pub input: String,
pub graphemes: Vec<(usize, u16)>,
pub before: usize,
pub width: u16,
}Fields§
§cursor: usize§input: String§graphemes: Vec<(usize, u16)>(byte_index, width)
before: usize§width: u16Implementations§
Source§impl InputUI
impl InputUI
pub fn new() -> Self
pub fn recompute_graphemes(&mut self)
pub fn byte_index(&self, grapheme_idx: usize) -> usize
pub fn str_at_cursor(&self) -> &str
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn set(&mut self, input: impl Into<Option<String>>, cursor: u16)
pub fn push_char(&mut self, c: char)
pub fn insert_str(&mut self, content: &str)
pub fn push_str(&mut self, content: &str)
pub fn scroll_to_cursor(&mut self, padding: usize)
pub fn cancel(&mut self)
pub fn prepare_column_change(&mut self)
Sourcepub fn set_at_visual_offset(&mut self, visual_offset: u16)
pub fn set_at_visual_offset(&mut self, visual_offset: u16)
Set cursor to a visual offset relative to start position
pub fn forward_char(&mut self)
pub fn backward_char(&mut self)
pub fn forward_word(&mut self)
pub fn backward_word(&mut self)
pub fn delete(&mut self)
pub fn delete_word(&mut self)
pub fn delete_line_start(&mut self)
pub fn delete_line_end(&mut self)
pub fn render(&self) -> &str
pub fn cursor_rel_offset(&self) -> u16
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InputUI
impl RefUnwindSafe for InputUI
impl Send for InputUI
impl Sync for InputUI
impl Unpin for InputUI
impl UnsafeUnpin for InputUI
impl UnwindSafe for InputUI
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> TransformExt for T
impl<T> TransformExt for T
fn transform<Q>(self, transform: impl FnOnce(T) -> Q) -> Q
fn modify<Q>(self, modify: impl FnOnce(&mut T) -> Q) -> T
Source§fn modify_if<Q>(self, condition: bool, modify: impl FnOnce(&mut T) -> Q) -> T
fn modify_if<Q>(self, condition: bool, modify: impl FnOnce(&mut T) -> Q) -> T
Example Read more