Skip to main content

StreamBytes

Trait StreamBytes 

Source
pub trait StreamBytes {
    // Required methods
    fn write(&mut self, buf: &[u8]) -> Result<usize, QdnfError>;
    fn read(&mut self, buf: &mut [u8]) -> Result<usize, QdnfError>;
    fn shutdown(&mut self) -> Result<(), QdnfError>;
}
Expand description

Non-blocking byte pipe. Named-pipe and UDS adapters implement this. Ok(n) is accepted bytes; cursors advance only by that n.

Required Methods§

Source

fn write(&mut self, buf: &[u8]) -> Result<usize, QdnfError>

Write up to buf.len() bytes.

Source

fn read(&mut self, buf: &mut [u8]) -> Result<usize, QdnfError>

Read up to buf.len() bytes. Ok(0) is orderly EOF.

Source

fn shutdown(&mut self) -> Result<(), QdnfError>

Close the byte pipe. Idempotent at this layer.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§