pub struct TimePicker<Msg: Clone> {
pub value: Time,
pub on_change: Option<Arc<dyn Fn(Time) -> Msg>>,
pub minute_step: u8,
pub second_step: u8,
pub seconds: bool,
pub twelve_hour: bool,
}Expand description
Time-of-day selector with up / down steppers per unit.
Fields§
§value: Time§on_change: Option<Arc<dyn Fn(Time) -> Msg>>§minute_step: u8§second_step: u8§seconds: bool§twelve_hour: boolImplementations§
Source§impl<Msg: Clone + 'static> TimePicker<Msg>
impl<Msg: Clone + 'static> TimePicker<Msg>
pub fn on_change(self, f: impl Fn(Time) -> Msg + 'static) -> Self
Sourcepub fn minute_step(self, step: u8) -> Self
pub fn minute_step(self, step: u8) -> Self
Step size for the minute up / down buttons. Common values: 1
(default), 5, 15. Clamped to 1..=30.
Sourcepub fn second_step(self, step: u8) -> Self
pub fn second_step(self, step: u8) -> Self
Step size for the second up / down buttons. Only meaningful
when Self::seconds is on. Clamped to 1..=30.
Sourcepub fn twelve_hour(self, on: bool) -> Self
pub fn twelve_hour(self, on: bool) -> Self
Display the hour as 12-hour with an AM / PM toggle. Internal
storage stays 24-hour. Default false.
Trait Implementations§
Source§impl<Msg: Clone + 'static> From<TimePicker<Msg>> for Element<Msg>
impl<Msg: Clone + 'static> From<TimePicker<Msg>> for Element<Msg>
Source§fn from(t: TimePicker<Msg>) -> Self
fn from(t: TimePicker<Msg>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<Msg> Freeze for TimePicker<Msg>
impl<Msg> !RefUnwindSafe for TimePicker<Msg>
impl<Msg> !Send for TimePicker<Msg>
impl<Msg> !Sync for TimePicker<Msg>
impl<Msg> Unpin for TimePicker<Msg>
impl<Msg> !UnwindSafe for TimePicker<Msg>
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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