Skip to main content

Publisher

Trait Publisher 

Source
pub trait Publisher {
    // Required method
    fn publish<E>(
        &self,
        message: E,
    ) -> impl Future<Output = Result<(), Error>> + Send
       where E: Event + Clone + 'static;
}
Expand description

Publishes events to the message bus.

Required Methods§

Source

fn publish<E>( &self, message: E, ) -> impl Future<Output = Result<(), Error>> + Send
where E: Event + Clone + 'static,

Publish an event to its subject.

§Errors

Returns Error::SendFailed if the message could not be published.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl Publisher for MockBus

Source§

impl<T> Publisher for MockPublisher<T>
where T: Event + Clone + 'static,