pub struct TimeOfDay { /* private fields */ }Expand description
An immutable wall-clock time in 24-hour form (M3ETime).
Every constructor clamps (M3ETimePickerUtils.clampRaw), so an instance is
always hour in 0..=23, minute in 0..=59 — the reference’s asserts made
total, since a release-mode Dart assert is a silent no-op and this crate
must not hand a malformed hour to the dial’s arithmetic.
Implementations§
Source§impl TimeOfDay
impl TimeOfDay
Sourcepub fn from_hour_12(hour_12: u8, pm: bool, minute: u8) -> Self
pub fn from_hour_12(hour_12: u8, pm: bool, minute: u8) -> Self
A time from a 12-hour hour (1..=12) plus a period flag —
M3ETimePickerUtils.to24Hour: (hour12 % 12) + if pm { 12 }.
Sourcepub fn hour_of_12(self) -> u8
pub fn hour_of_12(self) -> u8
The hour in 12-hour form, 1..=12 (M3ETime.hourOf12).
Sourcepub fn with_minute(self, minute: u8) -> Self
pub fn with_minute(self, minute: u8) -> Self
This time with a different minute (clamped).
Sourcepub fn with_period(self, pm: bool) -> Self
pub fn with_period(self, pm: bool) -> Self
This time moved to AM or PM, keeping the clock face
(_M3EDialTimePickerState._setPeriod).
Sourcepub fn hour_label(self, use_24_hour: bool) -> String
pub fn hour_label(self, use_24_hour: bool) -> String
The zero-padded two-digit hour the header field shows — the 24-hour
hour or the 12-hour one, per format (_buildHeader’s hourText).
Sourcepub fn minute_label(self) -> String
pub fn minute_label(self) -> String
The zero-padded two-digit minute (M3ETime.minuteLabel).
Sourcepub fn format(self, use_24_hour: bool, strings: &TimePickerStrings) -> String
pub fn format(self, use_24_hour: bool, strings: &TimePickerStrings) -> String
The dialog headline: "HH:MM" in 24-hour form, "H:MM AM" otherwise —
this port’s stand-in for MaterialLocalizations.formatTimeOfDay, whose
per-locale patterns have no home in this crate (see the module
docs’ Strings).
Trait Implementations§
impl Copy for TimeOfDay
impl Eq for TimeOfDay
Source§impl Ord for TimeOfDay
impl Ord for TimeOfDay
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for TimeOfDay
impl PartialOrd for TimeOfDay
impl StructuralPartialEq for TimeOfDay
Auto Trait Implementations§
impl Freeze for TimeOfDay
impl RefUnwindSafe for TimeOfDay
impl Send for TimeOfDay
impl Sync for TimeOfDay
impl Unpin for TimeOfDay
impl UnsafeUnpin for TimeOfDay
impl UnwindSafe for TimeOfDay
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
impl<T> Brush for T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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>
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>
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)
&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)
&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> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.