pub struct LabeledTextArea<'a> { /* private fields */ }
Expand description
Labeled Text Area
A variant of TextArea that adds a themed block around the text area and a reactive header with a title, an optional subtitle, and an optional twitter-like character count.
Implementationsยง
Sourceยงimpl<'a> LabeledTextArea<'a>
impl<'a> LabeledTextArea<'a>
Sourcepub fn new(th: LabeledTextAreaTheme) -> Self
pub fn new(th: LabeledTextAreaTheme) -> Self
Create a new LabeledTextArea with the given LabeledTextAreaTheme.
pub fn with_validations( self, validations: impl IntoIterator<Item = impl Fn(&str) -> Result<(), String> + Send + Sync + 'static>, ) -> Self
pub fn is_valid(&self) -> bool
pub fn validate(&mut self) -> ValidationResult
Sourcepub fn set_active(&mut self, active: bool)
pub fn set_active(&mut self, active: bool)
Set the text area to be active or not.
Sourcepub fn with_title(self, title: impl Into<String>) -> Self
pub fn with_title(self, title: impl Into<String>) -> Self
Set the title of the text area.
Sourcepub fn with_subtitle(self, subtitle: impl Into<String>) -> Self
pub fn with_subtitle(self, subtitle: impl Into<String>) -> Self
Set the subtitle of the text area.
Sourcepub fn with_active(self, active: bool) -> Self
pub fn with_active(self, active: bool) -> Self
Set the active status of the text area.
Sourcepub fn with_max_char_count(self, max_char_count: usize) -> Self
pub fn with_max_char_count(self, max_char_count: usize) -> Self
Set the maximum character count for the text area.
Sourcepub fn set_max_char_count(&mut self, max_char_count: usize)
pub fn set_max_char_count(&mut self, max_char_count: usize)
Set the maximum character count for the text area.
Sourcepub fn with_single_line(self, single_line: bool) -> Self
pub fn with_single_line(self, single_line: bool) -> Self
Set the text area to be single line or not.
pub fn char_count(&self) -> usize
pub fn input(&mut self, input: impl Into<Input>) -> bool
pub fn get_rect(&self, area: Rect) -> Rect
pub fn get_height(&self) -> u16
Sourcepub fn is_touched(&self) -> bool
pub fn is_touched(&self) -> bool
Get the touched status of the text area.
A text area is considered touched if it has been active at least once. This is useful to know if the user has interacted with the text area.
Trait Implementationsยง
Sourceยงimpl<'a> Clone for LabeledTextArea<'a>
impl<'a> Clone for LabeledTextArea<'a>
Sourceยงfn clone(&self) -> LabeledTextArea<'a>
fn clone(&self) -> LabeledTextArea<'a>
Returns a duplicate of the value. Read more
1.0.0 ยท Sourceยงfn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSourceยงimpl<'a> Default for LabeledTextArea<'a>
impl<'a> Default for LabeledTextArea<'a>
Auto Trait Implementationsยง
impl<'a> !Freeze for LabeledTextArea<'a>
impl<'a> !RefUnwindSafe for LabeledTextArea<'a>
impl<'a> Send for LabeledTextArea<'a>
impl<'a> Sync for LabeledTextArea<'a>
impl<'a> Unpin for LabeledTextArea<'a>
impl<'a> !UnwindSafe for LabeledTextArea<'a>
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Sourceยงfn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Sourceยงfn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Sourceยงfn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
โs vtable from &Trait
โs.Sourceยงfn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
โs vtable from &mut Trait
โs.Sourceยงimpl<T> DowncastSync for T
impl<T> DowncastSync for T
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