pub struct InputStates {
pub input: Vec<char>,
pub cursor: usize,
}Fields§
§input: Vec<char>§cursor: usizeImplementations§
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