Trait object::read::ReadCacheOps
source · pub trait ReadCacheOps {
// Required methods
fn len(&mut self) -> Result<u64, ()>;
fn seek(&mut self, pos: u64) -> Result<u64, ()>;
fn read(&mut self, buf: &mut [u8]) -> Result<usize, ()>;
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), ()>;
}
Expand description
Operations required to implement ReadCache
.
This is a subset of the Read
and Seek
traits.
A blanket implementation is provided for all types that implement
Read + Seek
.
Required Methods§
sourcefn len(&mut self) -> Result<u64, ()>
fn len(&mut self) -> Result<u64, ()>
Return the length of the stream.
Equivalent to std::io::Seek::seek(SeekFrom::End(0))
.
sourcefn seek(&mut self, pos: u64) -> Result<u64, ()>
fn seek(&mut self, pos: u64) -> Result<u64, ()>
Seek to the given position in the stream.
Equivalent to std::io::Seek::seek
with SeekFrom::Start(pos)
.