pub struct TextareaStates {
pub list_index: usize,
pub list_len: usize,
}Expand description
The state that has to be kept for the Textarea component.
Fields§
§list_index: usizeIndex of selected item in textarea
list_len: usizeLines in text area
Implementations§
Source§impl TextareaStates
impl TextareaStates
Sourcepub fn set_list_len(&mut self, len: usize)
pub fn set_list_len(&mut self, len: usize)
Set list length and fix list index.
Sourcepub fn incr_list_index(&mut self)
pub fn incr_list_index(&mut self)
Incremenet list index.
Sourcepub fn decr_list_index(&mut self)
pub fn decr_list_index(&mut self)
Decrement list index.
Sourcepub fn fix_list_index(&mut self)
pub fn fix_list_index(&mut self)
Keep index if possible, otherwise set to lenght - 1.
Sourcepub fn list_index_at_first(&mut self)
pub fn list_index_at_first(&mut self)
Set list index to the first item in the list.
Sourcepub fn list_index_at_last(&mut self)
pub fn list_index_at_last(&mut self)
Set list index at the last item of the list.
Trait Implementations§
Source§impl Default for TextareaStates
impl Default for TextareaStates
Source§fn default() -> TextareaStates
fn default() -> TextareaStates
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TextareaStates
impl RefUnwindSafe for TextareaStates
impl Send for TextareaStates
impl Sync for TextareaStates
impl Unpin for TextareaStates
impl UnsafeUnpin for TextareaStates
impl UnwindSafe for TextareaStates
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