Skip to main content

Transport

Trait Transport 

Source
pub trait Transport {
    // Required methods
    fn send(&mut self, message: &Message) -> Result<()>;
    fn recv(&mut self) -> Result<Option<Message>>;
}
Expand description

Something that carries messages to the other peer and back.

Required Methods§

Source

fn send(&mut self, message: &Message) -> Result<()>

Source

fn recv(&mut self) -> Result<Option<Message>>

The next message, or None when the other side has closed.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§