pub struct TimerProps {
pub mode: TimerMode,
pub to: TimerInstant,
pub from: TimerInstant,
pub format: TimerFormat,
pub announce: TimerAnnounce,
pub complete_label: Option<String>,
pub units: Vec<TimerUnit>,
pub now: Option<i64>,
pub on_complete: Option<EventHandler<()>>,
pub class: Option<String>,
pub attributes: Vec<Attribute>,
}Expand description
Props for Timer.
Fields§
§mode: TimerModeCountdown (default) or elapsed time.
to: TimerInstantCountdown target. Unset or invalid targets render the --:-- placeholder.
from: TimerInstantElapsed-time start.
format: TimerFormatClock renders 01:02:03; Units renders 1h 2m 3s.
announce: TimerAnnouncePolite live-region updates: at most once per minute, only at completion, or never.
complete_label: Option<String>Announced when a countdown reaches zero. Defaults to Timer complete.
units: Vec<TimerUnit>Displayed units, largest first. Defaults to days through seconds for a countdown and hours through seconds for elapsed time.
now: Option<i64>Clock for the first render, in epoch milliseconds, for deterministic server rendering and tests. Later ticks read the system clock.
on_complete: Option<EventHandler<()>>Called once when a running countdown reaches zero.
class: Option<String>Extra classes appended after the Lumen class.
attributes: Vec<Attribute>Any other <span> or global attribute.
Implementations§
Source§impl TimerProps
impl TimerProps
Sourcepub fn builder() -> TimerPropsBuilder<((), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> TimerPropsBuilder<((), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building TimerProps.
On the builder, call .mode(...)(optional), .to(...)(optional), .from(...)(optional), .format(...)(optional), .announce(...)(optional), .complete_label(...)(optional), .units(...)(optional), .now(...)(optional), .on_complete(...)(optional), .class(...)(optional), .attributes(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of TimerProps.
Trait Implementations§
Source§impl Clone for TimerProps
impl Clone for TimerProps
Source§impl PartialEq for TimerProps
impl PartialEq for TimerProps
Source§impl Properties for TimerPropswhere
Self: Clone,
impl Properties for TimerPropswhere
Self: Clone,
Source§type Builder = TimerPropsBuilder<((), (), (), (), (), (), (), (), (), (), ())>
type Builder = TimerPropsBuilder<((), (), (), (), (), (), (), (), (), (), ())>
Source§fn memoize(&mut self, new: &Self) -> bool
fn memoize(&mut self, new: &Self) -> bool
Source§fn into_vcomponent<M>(
self,
render_fn: impl ComponentFunction<Self, M>,
) -> VComponentwhere
M: 'static,
fn into_vcomponent<M>(
self,
render_fn: impl ComponentFunction<Self, M>,
) -> VComponentwhere
M: 'static,
impl StructuralPartialEq for TimerProps
Auto Trait Implementations§
impl !RefUnwindSafe for TimerProps
impl !Send for TimerProps
impl !Sync for TimerProps
impl !UnwindSafe for TimerProps
impl Forget for TimerProps
impl Freeze for TimerPropswhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<TimerUnit>: Freeze,
&'static UnsyncStorage: Freeze,
NonZero<u64>: Freeze,
&'static Location<'static>: Freeze,
PhantomData<Option<ExternalListenerCallback<(), ()>>>: Freeze,
PhantomData<Attribute>: Freeze,
impl Move for TimerProps
impl Unpin for TimerProps
impl UnsafeUnpin for TimerPropswhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<TimerUnit>: UnsafeUnpin,
&'static UnsyncStorage: UnsafeUnpin,
NonZeroU64Inner: UnsafeUnpin,
&'static Location<'static>: UnsafeUnpin,
PhantomData<Option<ExternalListenerCallback<(), ()>>>: UnsafeUnpin,
PhantomData<Attribute>: UnsafeUnpin,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DependencyElement for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
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> ⓘ
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> ⓘ
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