Skip to main content

Transport

Trait Transport 

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

Where messages come from and go to.

Required Methods§

Source

fn receive(&mut self) -> Result<Option<Incoming>, String>

The next message, without its line ending; None once the client has gone.

Source

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

Sends one message, whole, at once.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§