pub enum BodyReader<'a> {
    Contiguous(Cursor<&'a [u8]>),
    Scattered(GatheringReader<'a, Bytes>),
    FileSlice(ReadSlice),
}
Expand description

Provides a Read reference for a BodyImage in any state.

Variants§

§

Contiguous(Cursor<&'a [u8]>)

Cursor over a contiguous single RAM buffer, from Ram or MemMap. Also used for the empty case. Cursor::into_inner may be used for direct access to the memory byte slice.

§

Scattered(GatheringReader<'a, Bytes>)

GatheringReader providing Read over 2 or more scattered RAM buffers.

§

FileSlice(ReadSlice)

ReadSlice providing instance independent, unbuffered Read and Seek for BodyImage FsRead state, limited to a range within an underlying file. Consider wrapping this in std::io::BufReader if performing many small reads.

Implementations§

Return the Read reference.

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.