Skip to main content

MessageBusBacking

Trait MessageBusBacking 

Source
pub trait MessageBusBacking {
    // Required methods
    fn is_closed(&self) -> bool;
    fn publish(&self, message: BusMessage);
    fn close(&mut self);

    // Provided method
    fn take_receiver(&mut self) -> Result<MessageBusExternalReceiver> { ... }
}
Expand description

External message bus backing facade.

Implementations own the concrete backing technology and provide the runtime-facing publication surface used by the core bus. With the live feature, the same backing can also hand an inbound receiver to the live bridge.

Required Methods§

Source

fn is_closed(&self) -> bool

Returns true if the backing has been closed.

Source

fn publish(&self, message: BusMessage)

Queues a serialized bus message for external egress.

Source

fn close(&mut self)

Closes the backing and releases any owned resources.

Provided Methods§

Source

fn take_receiver(&mut self) -> Result<MessageBusExternalReceiver>

Takes the inbound message receiver for live bridge consumption.

§Errors

Returns an error if the receiver has already been taken or is unavailable.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§