Struct object::read::ReadCache [−][src]
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
impl<R: Read + Seek> ReadCache<R>
[src]
impl<R: Read + Seek> ReadCache<R>
[src]pub fn range(&self, offset: u64, size: u64) -> ReadCacheRange<'_, R>
[src]
pub fn range(&self, offset: u64, size: u64) -> ReadCacheRange<'_, R>
[src]Return an implementation of ReadRef
that restricts reads
to the given range of the stream.
pub fn into_inner(self) -> R
[src]
pub fn into_inner(self) -> R
[src]Unwrap this ReadCache<R>
, returning the underlying reader.
Trait Implementations
impl<'a, R: Read + Seek> ReadRef<'a> for &'a ReadCache<R>
[src]
impl<'a, R: Read + Seek> ReadRef<'a> for &'a ReadCache<R>
[src]fn read_bytes_at(self, offset: u64, size: u64) -> Result<&'a [u8], ()>
[src]
fn read_bytes_at(self, offset: u64, size: u64) -> Result<&'a [u8], ()>
[src]Get a reference to a u8
slice at the given offset. Read more
fn read_bytes_at_until(self, offset: u64, delimiter: u8) -> Result<&'a [u8], ()>
[src]
fn read_bytes_at_until(self, offset: u64, delimiter: u8) -> Result<&'a [u8], ()>
[src]Get a reference to a delimited u8
slice at the given offset. Read more
fn read_bytes(self, offset: &mut u64, size: u64) -> Result<&'a [u8], ()>
[src]
fn read_bytes(self, offset: &mut u64, size: u64) -> Result<&'a [u8], ()>
[src]Get a reference to a u8
slice at the given offset, and update the offset. Read more
fn read<T: Pod>(self, offset: &mut u64) -> Result<&'a T, ()>
[src]
fn read<T: Pod>(self, offset: &mut u64) -> Result<&'a T, ()>
[src]Get a reference to a Pod
type at the given offset, and update the offset. Read more
fn read_at<T: Pod>(self, offset: u64) -> Result<&'a T, ()>
[src]
fn read_at<T: Pod>(self, offset: u64) -> Result<&'a T, ()>
[src]Get a reference to a Pod
type at the given offset. Read more
Auto Trait Implementations
impl<R> !RefUnwindSafe for ReadCache<R>
impl<R> Send for ReadCache<R> where
R: Send,
R: Send,
impl<R> !Sync for ReadCache<R>
impl<R> Unpin for ReadCache<R> where
R: Unpin,
R: Unpin,
impl<R> UnwindSafe for ReadCache<R> where
R: UnwindSafe,
R: UnwindSafe,