Expand description
An implementation of ReadRef for data in a stream that implements
Read + Seek.
Contains a cache of read-only blocks of data, allowing references to them to be returned. Entries in the cache are never removed. Entries are keyed on the offset and size of the read. Currently overlapping reads are considered separate reads.
Implementations§
Trait Implementations§
source§impl<'a, R: Read + Seek> ReadRef<'a> for &'a ReadCache<R>
impl<'a, R: Read + Seek> ReadRef<'a> for &'a ReadCache<R>
source§fn read_bytes_at(self, offset: u64, size: u64) -> Result<&'a [u8], ()>
fn read_bytes_at(self, offset: u64, size: u64) -> Result<&'a [u8], ()>
Get a reference to a
u8 slice at the given offset. Read moresource§fn read_bytes_at_until(
self,
range: Range<u64>,
delimiter: u8
) -> Result<&'a [u8], ()>
fn read_bytes_at_until(
self,
range: Range<u64>,
delimiter: u8
) -> Result<&'a [u8], ()>
Get a reference to a delimited
u8 slice which starts at range.start. Read moresource§fn read_bytes(self, offset: &mut u64, size: u64) -> Result<&'a [u8], ()>
fn read_bytes(self, offset: &mut u64, size: u64) -> Result<&'a [u8], ()>
Get a reference to a
u8 slice at the given offset, and update the offset. Read moresource§fn read<T: Pod>(self, offset: &mut u64) -> Result<&'a T, ()>
fn read<T: Pod>(self, offset: &mut u64) -> Result<&'a T, ()>
Get a reference to a
Pod type at the given offset, and update the offset. Read moresource§fn read_at<T: Pod>(self, offset: u64) -> Result<&'a T, ()>
fn read_at<T: Pod>(self, offset: u64) -> Result<&'a T, ()>
Get a reference to a
Pod type at the given offset. Read more