#[repr(C)]pub struct TimePicker {
pub state: TimePickerStateWrapper,
pub container_style: CssPropertyWithConditionsVec,
}Expand description
A time picker: two clamped spinners (hour + minute) and an optional AM/PM toggle.
Fields§
§state: TimePickerStateWrapper§container_style: CssPropertyWithConditionsVecStyle for the row container.
Implementations§
Source§impl TimePicker
impl TimePicker
Sourcepub fn create(hour: u32, minute: u32) -> Self
pub fn create(hour: u32, minute: u32) -> Self
Creates a new 24-hour TimePicker with the given initial hour (0..=23)
and minute (0..=59), both clamped into range.
Sourcepub fn set_24h(&mut self, is_24h: bool)
pub fn set_24h(&mut self, is_24h: bool)
Switches between 24-hour (no AM/PM) and 12-hour (with AM/PM) display, re-clamping the hour into the new range.
Sourcepub fn with_24h(self, is_24h: bool) -> Self
pub fn with_24h(self, is_24h: bool) -> Self
Builder variant of Self::set_24h.
Sourcepub const fn set_pm(&mut self, is_pm: bool)
pub const fn set_pm(&mut self, is_pm: bool)
Sets the AM/PM flag (only meaningful in 12-hour mode).
Sourcepub const fn with_pm(self, is_pm: bool) -> Self
pub const fn with_pm(self, is_pm: bool) -> Self
Builder variant of Self::set_pm.
Sourcepub fn set_on_change<C: Into<TimePickerOnChangeCallback>>(
&mut self,
data: RefAny,
callback: C,
)
pub fn set_on_change<C: Into<TimePickerOnChangeCallback>>( &mut self, data: RefAny, callback: C, )
Sets the callback invoked when any value changes.
Sourcepub fn with_on_change<C: Into<TimePickerOnChangeCallback>>(
self,
data: RefAny,
callback: C,
) -> Self
pub fn with_on_change<C: Into<TimePickerOnChangeCallback>>( self, data: RefAny, callback: C, ) -> Self
Builder variant of Self::set_on_change.
Sourcepub fn swap_with_default(&mut self) -> Self
pub fn swap_with_default(&mut self) -> Self
Replaces self with the default value and returns the original.
pub fn dom(self) -> Dom
Trait Implementations§
Source§impl Clone for TimePicker
impl Clone for TimePicker
Source§fn clone(&self) -> TimePicker
fn clone(&self) -> TimePicker
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TimePicker
impl Debug for TimePicker
Source§impl Default for TimePicker
impl Default for TimePicker
impl Eq for TimePicker
Source§impl From<TimePicker> for Dom
impl From<TimePicker> for Dom
Source§fn from(t: TimePicker) -> Self
fn from(t: TimePicker) -> Self
Converts to this type from the input type.
Source§impl PartialEq for TimePicker
impl PartialEq for TimePicker
impl StructuralPartialEq for TimePicker
Auto Trait Implementations§
impl Freeze for TimePicker
impl RefUnwindSafe for TimePicker
impl Send for TimePicker
impl Sync for TimePicker
impl Unpin for TimePicker
impl UnsafeUnpin for TimePicker
impl UnwindSafe for TimePicker
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Compare self to
key and return true if they are equal.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