FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    TestSequencer

    struct · ferroui-reactiveui-testing · v0.5.0

    struct TestSequencer
    

    Two participants of a test that wait for each other phase by phase: each calls advance_phase_async at the end of its part of a phase, and the phase completes when both have (TestSequencer, a Barrier of two participants).

    Deviation (DEVIATIONS.md, ReactiveUI): the observables are single-threaded, so the two participants are two tasks of the current thread instead of two threads: the task of the first participant to arrive ends when the second one arrives, and the task of the second one has ended when advance_phase_async returns. A task is the Shared of a Result<(), ObservableError> (flatten() is a future of it); its continuations run when it ends, so upstream's Task.Yield() after the barrier has no counterpart.

    View source

    Members

    new

    fn new() -> Self
    

    A sequencer before its first phase.

    Source

    completed_phases

    fn completed_phases(self: &Self) -> i64
    

    The number of phases both participants completed (CompletedPhases).

    Source

    current_phase

    fn current_phase(self: &Self) -> i64
    

    The phase the participants are in, set when the first of them arrives (CurrentPhase).

    Source

    advance_phase_async

    fn advance_phase_async(self: &Self) -> Shared<Result<(), ObservableError>>
    

    Ends the part of the current phase of the calling participant; the task ends when the other participant has ended its part too (AdvancePhaseAsync()).

    Source

    advance_phase_async_with

    fn advance_phase_async_with(self: &Self, comment: &str) -> Shared<Result<(), ObservableError>>
    

    advance_phase_async, with a comment that names the phase for the reader of the test (AdvancePhaseAsync(string)).

    Panics

    When the sequencer is disposed, where upstream's barrier throws ObjectDisposedException.

    Source

    Trait implementations

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

    Availability

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