pub struct DatePicker<'a, Message, Theme>{ /* private fields */ }Expand description
Implementations§
Source§impl<'a, Message, Theme> DatePicker<'a, Message, Theme>
impl<'a, Message, Theme> DatePicker<'a, Message, Theme>
Sourcepub fn new<U, F>(
show_picker: bool,
date: impl Into<Date>,
underlay: U,
on_cancel: Message,
on_submit: F,
) -> Self
pub fn new<U, F>( show_picker: bool, date: impl Into<Date>, underlay: U, on_cancel: Message, on_submit: F, ) -> Self
Creates a new DatePicker wrapping around the given underlay.
It expects:
* if the overlay of the date picker is visible.
* the initial date to show.
* the underlay Element on which this DatePicker
will be wrapped around.
* a message that will be send when the cancel button of the DatePicker
is pressed.
* a function that will be called when the submit button of the DatePicker
is pressed, which takes the picked Date value.
Sourcepub fn style(self, style: impl Fn(&Theme, Status) -> Style + 'a) -> Self
pub fn style(self, style: impl Fn(&Theme, Status) -> Style + 'a) -> Self
Sets the style of the DatePicker.
Sourcepub fn font_size<P: Into<Pixels>>(self, size: P) -> Self
pub fn font_size<P: Into<Pixels>>(self, size: P) -> Self
Sets the font and icon size of the DatePicker.
Trait Implementations§
Source§impl<'a, Message, Theme> From<DatePicker<'a, Message, Theme>> for Element<'a, Message, Theme, Renderer>
impl<'a, Message, Theme> From<DatePicker<'a, Message, Theme>> for Element<'a, Message, Theme, Renderer>
Source§fn from(date_picker: DatePicker<'a, Message, Theme>) -> Self
fn from(date_picker: DatePicker<'a, Message, Theme>) -> Self
Converts to this type from the input type.
Source§impl<Message, Theme> Widget<Message, Theme, Renderer<Renderer, Renderer>> for DatePicker<'_, Message, Theme>
impl<Message, Theme> Widget<Message, Theme, Renderer<Renderer, Renderer>> for DatePicker<'_, Message, Theme>
Source§fn update(
&mut self,
state: &mut Tree,
event: &Event,
layout: Layout<'_>,
cursor: Cursor,
renderer: &Renderer,
clipboard: &mut dyn Clipboard,
shell: &mut Shell<'_, Message>,
viewport: &Rectangle,
)
fn update( &mut self, state: &mut Tree, event: &Event, layout: Layout<'_>, cursor: Cursor, renderer: &Renderer, clipboard: &mut dyn Clipboard, shell: &mut Shell<'_, Message>, viewport: &Rectangle, )
Source§fn mouse_interaction(
&self,
state: &Tree,
layout: Layout<'_>,
cursor: Cursor,
viewport: &Rectangle,
renderer: &Renderer,
) -> Interaction
fn mouse_interaction( &self, state: &Tree, layout: Layout<'_>, cursor: Cursor, viewport: &Rectangle, renderer: &Renderer, ) -> Interaction
Source§fn draw(
&self,
state: &Tree,
renderer: &mut Renderer,
theme: &Theme,
style: &Style,
layout: Layout<'_>,
cursor: Cursor,
viewport: &Rectangle,
)
fn draw( &self, state: &Tree, renderer: &mut Renderer, theme: &Theme, style: &Style, layout: Layout<'_>, cursor: Cursor, viewport: &Rectangle, )
Draws the
Widget using the associated Renderer.Auto Trait Implementations§
impl<'a, Message, Theme> Freeze for DatePicker<'a, Message, Theme>
impl<'a, Message, Theme> !RefUnwindSafe for DatePicker<'a, Message, Theme>
impl<'a, Message, Theme> !Send for DatePicker<'a, Message, Theme>
impl<'a, Message, Theme> !Sync for DatePicker<'a, Message, Theme>
impl<'a, Message, Theme> Unpin for DatePicker<'a, Message, Theme>
impl<'a, Message, Theme> !UnwindSafe for DatePicker<'a, Message, Theme>
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> 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> 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