Trait StreamOps

Source
pub trait StreamOps: Send + Sync {
    // Required methods
    fn read(&self, buffer: &mut [u8]) -> Result<usize, StreamError>;
    fn write(&self, buffer: &[u8]) -> Result<usize, StreamError>;
}
Expand description

Stream operations capability

This trait represents the ability to perform stream-like operations such as read, write, and seek on a resource.

Required Methods§

Source

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

Read data from the stream

Source

fn write(&self, buffer: &[u8]) -> Result<usize, StreamError>

Write data to the stream

Implementors§