pub trait MessageWriter: Send + Sync {
// Required methods
fn broadcast(&self, content: &str) -> BoxFuture<'_, Result<()>>;
fn reply_to(
&self,
username: &str,
content: &str,
) -> BoxFuture<'_, Result<()>>;
fn emit_event(
&self,
event_type: EventType,
content: &str,
params: Option<Value>,
) -> BoxFuture<'_, Result<()>>;
}Expand description
Async message dispatch for plugins. Abstracts over the broker’s broadcast and persistence machinery so plugins never touch broker internals.
The broker provides a concrete implementation; external crates only see this trait.
Required Methods§
Sourcefn broadcast(&self, content: &str) -> BoxFuture<'_, Result<()>>
fn broadcast(&self, content: &str) -> BoxFuture<'_, Result<()>>
Broadcast a system message to all connected clients and persist to history.