Skip to main content

MessageTransport

Trait MessageTransport 

Source
pub trait MessageTransport {
    // Required methods
    fn send(&mut self, message: &[u8]) -> Result<()>;
    fn recv(&mut self) -> Result<Vec<u8>>;
}
Expand description

A blocking transport of whole messages: WebSocket messages, datagrams, a shared-memory queue.

Required Methods§

Source

fn send(&mut self, message: &[u8]) -> Result<()>

Sends one message.

§Errors

When the transport fails.

Source

fn recv(&mut self) -> Result<Vec<u8>>

Receives the next message.

§Errors

When the transport fails or is closed.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§