Skip to main content

MessageTransport

Trait MessageTransport 

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

An asynchronous transport of whole messages.

Required Methods§

Source

fn send(&mut self, message: &[u8]) -> impl Future<Output = Result<()>> + Send

Sends one message.

Source

fn recv(&mut self) -> impl Future<Output = Result<Vec<u8>>> + Send

Receives the next message.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§