FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    Members

    new

    fn new() -> Self
    

    Source

    has_subscriptions

    fn has_subscriptions(self: &Self) -> bool
    

    Whether anything is subscribed to the clock.

    Source

    play_state

    fn play_state(self: &Self) -> PlayState
    

    The playback state of the clock.

    Source

    set_play_state

    fn set_play_state(self: &Self, value: PlayState)
    

    Sets the playback state of the clock.

    Source

    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.

    Source

    subscribe

    fn subscribe(self: &Self, observer: Rc<dyn IObserver<SignedDuration>>) -> Rc<dyn IDisposable>
    

    Subscribes to the clock's time.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ErasedDestructor
    • IntoEither
    • Default

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.