pub trait Publisher: Send + Sync {
// Required methods
fn publish(&self, subject: &str, payload: Bytes) -> Result<(), Error>;
fn flush(&self) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>;
}Expand description
Publisher trait for sending messages to subjects.
Publishers are responsible for sending messages to named subjects. Messages are delivered to all subscribers matching the subject pattern.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".