FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    VirtualTimeScheduler

    struct · ferroui-reactive · v0.5.0

    struct VirtualTimeScheduler<C: VirtualTimeClock>
    

    A scheduler of virtual time (VirtualTimeScheduler<TAbsolute, TRelative>): work runs when the clock is advanced to its due time (start, advance_to, advance_by), in the order of due times and, for equal ones, in the order it was scheduled.

    View source

    Members

    historical

    fn historical() -> Rc<Self>
    

    A historical scheduler with its clock at the epoch of the system time.

    Deviation (DEVIATIONS.md, Reactive): upstream starts at DateTimeOffset.MinValue; the system time has no such minimum, and the epoch is the earliest time every platform has.

    Source

    historical_at

    fn historical_at(initial_clock: SystemTime) -> Rc<Self>
    

    A historical scheduler with its clock at initial_clock.

    Source

    new

    fn new(initial_clock: <C as >::Absolute) -> Rc<Self>
    

    A scheduler with its clock at initial_clock.

    Source

    clock

    fn clock(self: &Self) -> <C as >::Absolute
    

    The current time of the clock (Clock).

    Source

    set_clock

    fn set_clock(self: &Self, clock: <C as >::Absolute)
    

    Sets the clock (Clock's protected setter), for derived schedulers.

    Source

    is_enabled

    fn is_enabled(self: &Self) -> bool
    

    Whether the scheduler is running work (IsEnabled).

    Source

    schedule_absolute

    fn schedule_absolute(self: &Self, due_time: <C as >::Absolute, action: ScheduledAction) -> Rc<dyn IDisposable>
    

    Schedules work at an absolute virtual time (ScheduleAbsolute).

    Source

    schedule_relative

    fn schedule_relative(self: &Self, due_time: <C as >::Relative, action: ScheduledAction) -> Rc<dyn IDisposable>
    

    Schedules work at a virtual time relative to the clock (ScheduleRelative).

    Source

    start

    fn start(self: &Self)
    

    Runs the queued work, moving the clock to the due time of each, until there is none or the scheduler is stopped (Start).

    Source

    stop

    fn stop(self: &Self)
    

    Stops the scheduler after the work that runs (Stop).

    Source

    advance_to

    fn advance_to(self: &Self, time: <C as >::Absolute)
    

    Runs the work due up to time and moves the clock to it (AdvanceTo). Panics when time is before the clock or the scheduler is running, where upstream throws.

    Source

    advance_by

    fn advance_by(self: &Self, time: <C as >::Relative)
    

    Runs the work due within time from the clock and moves the clock by it (AdvanceBy).

    Source

    sleep

    fn sleep(self: &Self, time: <C as >::Relative)
    

    Moves the clock by time without running work (Sleep).

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • IScheduler
    • IStopwatchProvider

    Availability

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