FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    MessageBusExtensions

    trait · ferroui-reactiveui-testing · v0.5.0

    trait MessageBusExtensions
    

    Runs code with a message bus as MessageBus::current (MessageBusExtensions).

    Deviation (DEVIATIONS.md, ReactiveUI): the current message bus is per thread, so upstream's lock (Monitor.Enter(messageBusGate)), which keeps the tests of other threads from replacing it in between, is not needed and not ported.

    View source

    Members

    as_message_bus

    fn as_message_bus(self: &Self) -> Rc<dyn IMessageBus>
    

    The message bus as the handle that MessageBus::current holds.

    Source

    with_message_bus

    fn with_message_bus(self: &Self) -> Rc<dyn IDisposable>
    

    Makes the message bus MessageBus::current until the returned disposable is disposed, which restores the message bus that was current before (WithMessageBus).

    Source

    with

    fn with<R>(self: &Self, block: impl FnOnce() -> R) -> R
    

    Runs block with the message bus as MessageBus::current and returns its result; the message bus current before is restored afterwards, also when block panics (With<TRet>(Func<TRet>), and With(Action) with a block that returns ()).

    Not ported: the ArgumentException of a null block - argument validation.

    Source

    Trait implementations

    Availability

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