OutboxWriterExt

Trait OutboxWriterExt 

Source
pub trait OutboxWriterExt {
    // Required methods
    fn send_text(&mut self, to: ClientId, text: impl Into<String>);
    fn send_command(&mut self, to: ClientId, command: impl Into<Vec<u8>>);
    fn send_gmcp(&mut self, to: ClientId, payload: Payload);
}
Expand description

Extension trait for EventWriter<Outbox> to make sending messages easier.

Required Methodsยง

Source

fn send_text(&mut self, to: ClientId, text: impl Into<String>)

Source

fn send_command(&mut self, to: ClientId, command: impl Into<Vec<u8>>)

Source

fn send_gmcp(&mut self, to: ClientId, payload: Payload)

Dyn Compatibilityยง

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Typesยง

Sourceยง

impl OutboxWriterExt for EventWriter<'_, Outbox>

Sourceยง

fn send_text(&mut self, to: ClientId, text: impl Into<String>)

Sends a Message::Text to a client.

Sourceยง

fn send_command(&mut self, to: ClientId, command: impl Into<Vec<u8>>)

Sends a Message::Command to a client.

Sourceยง

fn send_gmcp(&mut self, to: ClientId, payload: Payload)

Sends a Message::GMCP to a client.

Implementorsยง