IMessageBusExt
trait · ferroui-reactiveui · v0.5.0
trait IMessageBusExt
The typed operations of a message bus (the generic methods of IMessageBus), on its shared
handle: Rc<MessageBus> and Rc<dyn IMessageBus> have them.
The type of the message is a type parameter; a message type has a default value, which
listen_include_latest gives before any message was sent
(upstream's default(T)). A contract of None is upstream's null.
Members
register_schedulerregister_scheduler_with_contractlistenlisten_with_contractlisten_include_latestlisten_include_latest_with_contractregister_message_sourceregister_message_source_with_contractsend_messagesend_message_with_contract
register_scheduler
fn register_scheduler<T: 'static>(self: &Self, scheduler: Rc<dyn IScheduler>)
Registers the scheduler that delivers the messages of T without a contract, replacing
the one registered before (RegisterScheduler<T>(IScheduler)).
register_scheduler_with_contract
fn register_scheduler_with_contract<T: 'static>(self: &Self, scheduler: Rc<dyn IScheduler>, contract: Option<&str>)
Registers the scheduler that delivers the messages of T with contract
(RegisterScheduler<T>(IScheduler, string?)).
listen
fn listen<T: Clone + Default + 'static>(self: &Self) -> Rc<dyn IObservable<T>>
The messages of T sent after the subscription (Listen<T>()). The channel is created
when the observable is subscribed.
listen_with_contract
fn listen_with_contract<T: Clone + Default + 'static>(self: &Self, contract: Option<&str>) -> Rc<dyn IObservable<T>>
The messages of T with contract sent after the subscription (Listen<T>(string?)).
listen_include_latest
fn listen_include_latest<T: Clone + Default + 'static>(self: &Self) -> Rc<dyn IObservable<T>>
The latest message of T (or its default value) at once, then the later ones
(ListenIncludeLatest<T>()).
listen_include_latest_with_contract
fn listen_include_latest_with_contract<T: Clone + Default + 'static>(self: &Self, contract: Option<&str>) -> Rc<dyn IObservable<T>>
The latest message of T with contract, then the later ones
(ListenIncludeLatest<T>(string?)).
register_message_source
fn register_message_source<T: Clone + Default + 'static>(self: &Self, source: Rc<dyn IObservable<T>>) -> Rc<dyn IDisposable>
Sends each value of source as a message of T, until the returned disposable is
disposed; an error or the end of source is logged and leaves the channel open
(RegisterMessageSource<T>(IObservable<T>)).
register_message_source_with_contract
fn register_message_source_with_contract<T: Clone + Default + 'static>(self: &Self, source: Rc<dyn IObservable<T>>, contract: Option<&str>) -> Rc<dyn IDisposable>
register_message_source on the channel of contract
(RegisterMessageSource<T>(IObservable<T>, string?)).
send_message
fn send_message<T: Clone + Default + 'static>(self: &Self, message: T)
Sends one message of T (SendMessage<T>(T)). For messages that answer other changes,
register_message_source is the better fit.
send_message_with_contract
fn send_message_with_contract<T: Clone + Default + 'static>(self: &Self, message: T, contract: Option<&str>)
Sends one message of T on the channel of contract (SendMessage<T>(T, string?)).
Trait implementations
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.