Trait wildland_dfs::stream::IStream
source · pub trait IStream: Send + Sync {
// Required methods
fn read(&mut self, bytes_count: usize) -> Result<Vec<u8, Global>, StreamErr>;
fn total_size(&self) -> usize;
}
Expand description
Trait representing input stream which CoreX can read from.
It must be safe to send it between threads.
Required Methods§
sourcefn read(&mut self, bytes_count: usize) -> Result<Vec<u8, Global>, StreamErr>
fn read(&mut self, bytes_count: usize) -> Result<Vec<u8, Global>, StreamErr>
Reads at most number of bytes specified by the bytes_count
argument.
Empty vector in IStreamResult::Ok(..)
means end of stream.
sourcefn total_size(&self) -> usize
fn total_size(&self) -> usize
Provides total size of a Stream in bytes
If None
returned, operation progress can not be tracked