Skip to main content

Transport

Trait Transport 

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

What carries one side’s batches to the other: a queue in one process, a socket and ring between processes, postMessage between a page and a worker. At most one batch a frame.

Required Methods§

Source

fn send(&mut self, batch: Vec<u8>) -> Result<(), WireError>

Hand batch to the other side.

Source

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

The next batch the other side sent, when one waits.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§