[go: up one dir, main page]

Struct object::read::ReadCache

source ·
pub struct ReadCache<R: Read + Seek> { /* private fields */ }
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§

Create an empty ReadCache for the given stream.

Return an implementation of ReadRef that restricts reads to the given range of the stream.

Free buffers used by the cache.

Unwrap this ReadCache<R>, returning the underlying reader.

Trait Implementations§

Formats the value using the given formatter. Read more
The total size of the block of data.
Get a reference to a u8 slice at the given offset. Read more
Get a reference to a delimited u8 slice which starts at range.start. Read more
Get a reference to a u8 slice at the given offset, and update the offset. Read more
Get a reference to a Pod type at the given offset, and update the offset. Read more
Get a reference to a Pod type at the given offset. Read more
Get a reference to a slice of a Pod type at the given offset, and update the offset. Read more
Get a reference to a slice of a Pod type at the given offset. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.