Skip to main content

TestSchedulerExtensions

Trait TestSchedulerExtensions 

Source
pub trait TestSchedulerExtensions {
    // Required methods
    fn from_time_span(span: Duration) -> i64;
    fn on_next_at<T>(milliseconds: f64, value: T) -> Recorded<Notification<T>>;
    fn on_error_at<T>(
        milliseconds: f64,
        error: ObservableError,
    ) -> Recorded<Notification<T>>;
    fn on_completed_at<T>(milliseconds: f64) -> Recorded<Notification<T>>;
    fn advance_to_ms(&self, milliseconds: f64);
    fn advance_by_ms(&self, milliseconds: f64);
}
Expand description

The virtual time of a TestScheduler in milliseconds, and recorded notifications at a time in milliseconds (TestSchedulerExtensions, from ReactiveUI.Testing.Reactive).

The functions without a scheduler are called on the type, as upstream’s static extension members are: TestScheduler::on_next_at(100.0, 42).

Not ported: the ArgumentException of a time that is not a number and the OverflowException of one too large for a TimeSpan - argument validation (the conversion saturates).

Required Methods§

Source

fn from_time_span(span: Duration) -> i64

The ticks of the virtual time of a duration (FromTimeSpan).

Source

fn on_next_at<T>(milliseconds: f64, value: T) -> Recorded<Notification<T>>

A value at a time in milliseconds (OnNextAt<T>(double, T)).

Source

fn on_error_at<T>( milliseconds: f64, error: ObservableError, ) -> Recorded<Notification<T>>

An error at a time in milliseconds (OnErrorAt<T>(double, Exception)).

Source

fn on_completed_at<T>(milliseconds: f64) -> Recorded<Notification<T>>

The end of a sequence at a time in milliseconds (OnCompletedAt<T>(double)).

Source

fn advance_to_ms(&self, milliseconds: f64)

Runs the scheduler until its clock reaches the absolute time in milliseconds (AdvanceToMs).

Source

fn advance_by_ms(&self, milliseconds: f64)

Runs the scheduler for a time in milliseconds (AdvanceByMs).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl TestSchedulerExtensions for TestScheduler

Source§

fn from_time_span(span: Duration) -> i64

Source§

fn on_next_at<T>(milliseconds: f64, value: T) -> Recorded<Notification<T>>

Source§

fn on_error_at<T>( milliseconds: f64, error: ObservableError, ) -> Recorded<Notification<T>>

Source§

fn on_completed_at<T>(milliseconds: f64) -> Recorded<Notification<T>>

Source§

fn advance_to_ms(&self, milliseconds: f64)

Source§

fn advance_by_ms(&self, milliseconds: f64)

Implementors§