pub struct DateInput { /* private fields */ }Expand description
A text field over a host-owned calendar, with that calendar in a popover.
Implementations§
Source§impl DateInput
impl DateInput
pub fn new( ident: impl Into<Ident>, adapter: SharedDateAdapter, window: &mut Window, cx: &mut Context<'_, Self>, ) -> Self
pub fn required(self, required: bool) -> Self
Sourcepub fn set_value(&mut self, day: Option<Day>, cx: &mut Context<'_, Self>)
pub fn set_value(&mut self, day: Option<Day>, cx: &mut Context<'_, Self>)
Replaces the day from the host side.
The host already knows the day it just set, so this reports nothing.
pub fn set_disabled(&mut self, disabled: bool, cx: &mut Context<'_, Self>)
pub fn field(&self) -> &Entity<TextInput>
pub fn calendar(&self) -> &Entity<Calendar>
pub fn current(&self) -> Option<Day>
Sourcepub fn message(&self) -> Option<&SharedString>
pub fn message(&self) -> Option<&SharedString>
The adapter’s reason for refusing the current text, or None.
pub fn is_open(&self) -> bool
Sourcepub fn shown_text(&self, cx: &App) -> SharedString
pub fn shown_text(&self, cx: &App) -> SharedString
The text as the typist left it, which is not the host’s value while an edit is in progress.
pub fn is_invalid(&self) -> bool
pub fn open(&mut self, cx: &mut Context<'_, Self>)
pub fn close(&mut self, cx: &mut Context<'_, Self>)
pub fn toggle(&mut self, cx: &mut Context<'_, Self>)
Trait Implementations§
impl EventEmitter<DateInputEvent> for DateInput
Source§impl Focusable for DateInput
impl Focusable for DateInput
Source§fn focus_handle(&self, _cx: &App) -> FocusHandle
fn focus_handle(&self, _cx: &App) -> FocusHandle
Returns the focus handle associated with this view.
Auto Trait Implementations§
impl !RefUnwindSafe for DateInput
impl !Send for DateInput
impl !Sync for DateInput
impl !UnwindSafe for DateInput
impl Freeze for DateInput
impl Unpin for DateInput
impl UnsafeUnpin for DateInput
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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