ClockBase
struct · ferroui-base · v0.5.0
struct ClockBase
The shared implementation of clocks that are driven by another time source: converts the source's time to the time elapsed since this clock's first pulse, not counting the time spent paused.
The owning clock forwards its source's ticks to pulse
and supplies what to do when the clock stops.
Members
new
fn new() -> Self
has_subscriptions
fn has_subscriptions(self: &Self) -> bool
Whether anything is subscribed to the clock.
play_state
fn play_state(self: &Self) -> PlayState
The playback state of the clock.
set_play_state
fn set_play_state(self: &Self, value: PlayState)
Sets the playback state of the clock.
pulse
fn pulse(self: &Self, system_time: SignedDuration, stop: impl FnOnce() -> ())
Advances the clock to system_time and notifies the subscribers.
stop runs afterwards if the clock has been stopped.
subscribe
fn subscribe(self: &Self, observer: Rc<dyn IObserver<SignedDuration>>) -> Rc<dyn IDisposable>
Subscribes to the clock's time.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyErasedDestructorIntoEitherDefault
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.