Struct rat_input::date_input::DateInputState
source · pub struct DateInputState {
pub widget: MaskedInputState,
pub non_exhaustive: NonExhaustive,
/* private fields */
}Expand description
State.
Use DateInputState::new(_pattern_) to set the date pattern.
Fields§
§widget: MaskedInputStateuses MaskedInputState for the actual functionality.
non_exhaustive: NonExhaustiveImplementations§
source§impl DateInputState
impl DateInputState
pub fn new<S: AsRef<str>>(pattern: S) -> Result<Self, Error>
pub fn new_localized<S: AsRef<str>>( pattern: S, locale: Locale ) -> Result<Self, Error>
sourcepub fn set_format<S: AsRef<str>>(&mut self, pattern: S) -> Result<(), Error>
pub fn set_format<S: AsRef<str>>(&mut self, pattern: S) -> Result<(), Error>
chrono format string.
generates a mask according to the format and overwrites whatever set_mask() did.
sourcepub fn set_format_loc<S: AsRef<str>>(
&mut self,
pattern: S,
locale: Locale
) -> Result<(), Error>
pub fn set_format_loc<S: AsRef<str>>( &mut self, pattern: S, locale: Locale ) -> Result<(), Error>
chrono format string.
generates a mask according to the format and overwrites whatever set_mask() did.
sourcepub fn value(&self) -> Result<NaiveDate, ParseError>
pub fn value(&self) -> Result<NaiveDate, ParseError>
Parses the text according to the given pattern.
sourcepub fn select_all(&mut self)
pub fn select_all(&mut self)
Select all text.
sourcepub fn screen_cursor(&self) -> Option<(u16, u16)>
pub fn screen_cursor(&self) -> Option<(u16, u16)>
Screen position of the cursor for rendering.
Trait Implementations§
source§impl Clone for DateInputState
impl Clone for DateInputState
source§fn clone(&self) -> DateInputState
fn clone(&self) -> DateInputState
Returns a copy 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 Debug for DateInputState
impl Debug for DateInputState
source§impl Default for DateInputState
impl Default for DateInputState
source§impl HandleEvent<Event, ConvenientKeys, TextOutcome> for DateInputState
impl HandleEvent<Event, ConvenientKeys, TextOutcome> for DateInputState
source§fn handle(&mut self, event: &Event, _keymap: ConvenientKeys) -> TextOutcome
fn handle(&mut self, event: &Event, _keymap: ConvenientKeys) -> TextOutcome
Handle an event. Read more
source§impl HandleEvent<Event, FocusKeys, TextOutcome> for DateInputState
impl HandleEvent<Event, FocusKeys, TextOutcome> for DateInputState
source§impl HandleEvent<Event, MouseOnly, TextOutcome> for DateInputState
impl HandleEvent<Event, MouseOnly, TextOutcome> for DateInputState
source§impl HandleEvent<Event, ReadOnly, TextOutcome> for DateInputState
impl HandleEvent<Event, ReadOnly, TextOutcome> for DateInputState
Auto Trait Implementations§
impl !Freeze for DateInputState
impl !RefUnwindSafe for DateInputState
impl Send for DateInputState
impl !Sync for DateInputState
impl Unpin for DateInputState
impl UnwindSafe for DateInputState
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