Skip to main content

MessageBusExternalEgress

Trait MessageBusExternalEgress 

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

External egress surface for serialized message bus publications.

The core bus passes each outbound message as a BusMessage carrying the topic, payload_type, and serialized payload. Implementations must not block the publishing thread. If the underlying channel is full, drop the message in the implementation rather than applying back-pressure to the node.

Required Methods§

Source

fn is_closed(&self) -> bool

Returns true if egress has been closed.

Source

fn publish(&self, message: BusMessage)

Queues a serialized bus message for external egress.

Source

fn close(&mut self)

Closes egress and stops accepting outbound messages.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§