pub struct TimePickerState { /* private fields */ }Expand description
Holds the current selection for a time picker.
Implementations§
Source§impl TimePickerState
impl TimePickerState
Sourcepub fn new(
initial_hour: u8,
initial_minute: u8,
is_24_hour: bool,
display_mode: TimePickerDisplayMode,
) -> Self
pub fn new( initial_hour: u8, initial_minute: u8, is_24_hour: bool, display_mode: TimePickerDisplayMode, ) -> Self
Creates a time picker state with the provided initial values.
Sourcepub fn is_24_hour(&self) -> bool
pub fn is_24_hour(&self) -> bool
Returns whether the picker uses 24-hour mode.
Sourcepub fn display_mode(&self) -> TimePickerDisplayMode
pub fn display_mode(&self) -> TimePickerDisplayMode
Returns the display mode.
Sourcepub fn selection(&self) -> TimePickerSelection
pub fn selection(&self) -> TimePickerSelection
Returns the time unit currently selected for adjustment or manual entry.
Sourcepub fn hour_for_display(&self) -> u8
pub fn hour_for_display(&self) -> u8
Returns the hour to display in the UI.
Sourcepub fn set_minute(&mut self, minute: u8)
pub fn set_minute(&mut self, minute: u8)
Sets the minute, clamped to 0-59.
Sourcepub fn set_is_24_hour(&mut self, is_24_hour: bool)
pub fn set_is_24_hour(&mut self, is_24_hour: bool)
Sets 24-hour mode on or off.
Sourcepub fn set_display_mode(&mut self, mode: TimePickerDisplayMode)
pub fn set_display_mode(&mut self, mode: TimePickerDisplayMode)
Sets the display mode.
Sourcepub fn toggle_display_mode(&mut self)
pub fn toggle_display_mode(&mut self)
Toggles between picker and input modes.
Sourcepub fn set_period(&mut self, period: DayPeriod)
pub fn set_period(&mut self, period: DayPeriod)
Updates the period when in 12-hour mode.
Sourcepub fn increment_hour(&mut self, step: u8)
pub fn increment_hour(&mut self, step: u8)
Increments the hour by the given step, wrapping around.
Sourcepub fn decrement_hour(&mut self, step: u8)
pub fn decrement_hour(&mut self, step: u8)
Decrements the hour by the given step, wrapping around.
Sourcepub fn increment_minute(&mut self, step: u8)
pub fn increment_minute(&mut self, step: u8)
Increments the minute by the given step, wrapping around.
Sourcepub fn decrement_minute(&mut self, step: u8)
pub fn decrement_minute(&mut self, step: u8)
Decrements the minute by the given step, wrapping around.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TimePickerState
impl RefUnwindSafe for TimePickerState
impl Send for TimePickerState
impl Sync for TimePickerState
impl Unpin for TimePickerState
impl UnsafeUnpin for TimePickerState
impl UnwindSafe for TimePickerState
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
§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> 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>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn 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>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which 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)
Converts
&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)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.