pub trait Transport {
// Required methods
fn read(&mut self, buf: &mut [u8]) -> usize;
fn write(&mut self, buf: &[u8]) -> usize;
}Expand description
Non-blocking byte-stream transport.
Both methods are non-blocking and return the number of bytes transferred.
Returning 0 means no bytes were available (read) or the sink was full
(write). Callers must poll in a loop rather than block.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".