FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    TestScheduler

    struct · ferroui-reactive-testing · v0.5.0

    struct TestScheduler
    

    A virtual-time scheduler for tests, whose clock counts ticks (TestScheduler). It dereferences to the virtual-time scheduler (clock, start, advance_to, advance_by, sleep, schedule_absolute, ...).

    View source

    Members

    new

    fn new() -> Self
    

    A scheduler with its clock at zero.

    Source

    scheduler

    fn scheduler(self: &Self) -> Rc<dyn IScheduler>
    

    The scheduler as the handle operators take.

    Source

    schedule_absolute_action

    fn schedule_absolute_action(self: &Self, due_time: i64, action: impl FnOnce() -> () + 'static) -> Rc<dyn IDisposable>
    

    Schedules an action at an absolute virtual time.

    Source

    start_with

    fn start_with<T: Clone + 'static>(self: &Self, create: impl FnOnce() -> Rc<dyn IObservable<T>> + 'static, created: i64, subscribed: i64, disposed: i64) -> Rc<MockObserver<T>>
    

    Creates the sequence at created, subscribes an observer at subscribed and disposes the subscription at disposed, runs the scheduler, and returns the observer with what it recorded (Start(Func<IObservable<T>>, long, long, long)).

    Source

    start_disposed

    fn start_disposed<T: Clone + 'static>(self: &Self, create: impl FnOnce() -> Rc<dyn IObservable<T>> + 'static, disposed: i64) -> Rc<MockObserver<T>>
    

    start_with at the default times, created at 100, subscribed at 200 and disposed at disposed (Start(Func<IObservable<T>>, long)).

    Source

    start

    fn start<T: Clone + 'static>(self: &Self, create: impl FnOnce() -> Rc<dyn IObservable<T>> + 'static) -> Rc<MockObserver<T>>
    

    start_with at the default times: created at 100, subscribed at 200, disposed at 1000 (Start(Func<IObservable<T>>)).

    Source

    run

    fn run(self: &Self)
    

    Runs the queued work (VirtualTimeScheduler.Start()).

    Source

    create_hot_observable

    fn create_hot_observable<T: Clone + 'static>(self: &Self, messages: Vec<Recorded<Notification<T>>>) -> Rc<HotObservable<T>>
    

    A sequence that notifies its messages at their absolute times to the observers subscribed then (CreateHotObservable).

    Source

    create_cold_observable

    fn create_cold_observable<T: Clone + 'static>(self: &Self, messages: Vec<Recorded<Notification<T>>>) -> Rc<ColdObservable<T>>
    

    A sequence that notifies its messages at their times relative to each subscription (CreateColdObservable).

    Source

    create_observer

    fn create_observer<T: 'static>(self: &Self) -> Rc<MockObserver<T>>
    

    An observer that records what it receives with the time (CreateObserver).

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Receiver
    • Any
    • ToOwned
    • Clone
    • Default
    • Deref

    Availability

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