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: MaskedInputState

uses MaskedInputState for the actual functionality.

§non_exhaustive: NonExhaustive

Implementations§

source§

impl DateInputState

source

pub fn new<S: AsRef<str>>(pattern: S) -> Result<Self, Error>

source

pub fn new_localized<S: AsRef<str>>( pattern: S, locale: Locale ) -> Result<Self, Error>

source

pub fn clear(&mut self)

Reset to empty.

source

pub fn format(&self) -> &str

chrono format string.

source

pub fn locale(&self) -> Locale

chrono locale.

source

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.

source

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.

source

pub fn value(&self) -> Result<NaiveDate, ParseError>

Parses the text according to the given pattern.

source

pub fn set_value(&mut self, date: NaiveDate)

Set the date value.

source

pub fn select_all(&mut self)

Select all text.

source

pub fn screen_cursor(&self) -> Option<(u16, u16)>

Screen position of the cursor for rendering.

Trait Implementations§

source§

impl Clone for DateInputState

source§

fn clone(&self) -> DateInputState

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for DateInputState

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for DateInputState

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl HandleEvent<Event, ConvenientKeys, TextOutcome> for DateInputState

source§

fn handle(&mut self, event: &Event, _keymap: ConvenientKeys) -> TextOutcome

Handle an event. Read more
source§

impl HandleEvent<Event, FocusKeys, TextOutcome> for DateInputState

source§

fn handle(&mut self, event: &Event, _keymap: FocusKeys) -> TextOutcome

Handle an event. Read more
source§

impl HandleEvent<Event, MouseOnly, TextOutcome> for DateInputState

source§

fn handle(&mut self, event: &Event, _keymap: MouseOnly) -> TextOutcome

Handle an event. Read more
source§

impl HandleEvent<Event, ReadOnly, TextOutcome> for DateInputState

source§

fn handle(&mut self, event: &Event, _keymap: ReadOnly) -> TextOutcome

Handle an event. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.