pub struct InputStates {
pub input: Vec<char>,
pub cursor: usize,
}
Fields§
§input: Vec<char>
§cursor: usize
Implementations§
Source§impl InputStates
impl InputStates
Sourcepub fn append(&mut self, ch: char, itype: &InputType, max_len: Option<usize>)
pub fn append(&mut self, ch: char, itype: &InputType, max_len: Option<usize>)
§append
Append, if possible according to input type, the character to the input vec
Sourcepub fn incr_cursor(&mut self)
pub fn incr_cursor(&mut self)
§incr_cursor
Increment cursor value by one if possible
Sourcepub fn cursor_at_begin(&mut self)
pub fn cursor_at_begin(&mut self)
§cursoro_at_begin
Place cursor at the begin of the input
Sourcepub fn cursor_at_end(&mut self)
pub fn cursor_at_end(&mut self)
§cursor_at_end
Place cursor at the end of the input
Sourcepub fn decr_cursor(&mut self)
pub fn decr_cursor(&mut self)
§decr_cursor
Decrement cursor value by one if possible
Sourcepub fn render_value(&self, itype: InputType) -> String
pub fn render_value(&self, itype: InputType) -> String
§render_value
Get value as string to render
Trait Implementations§
Source§impl Default for InputStates
impl Default for InputStates
Source§fn default() -> InputStates
fn default() -> InputStates
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for InputStates
impl RefUnwindSafe for InputStates
impl Send for InputStates
impl Sync for InputStates
impl Unpin for InputStates
impl UnwindSafe for InputStates
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> 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 more