pub struct BytesSource { /* private fields */ }
Expand description

A source for a bytes value.

Implementations

Creates a new bytes source from a bytes values.

Creates a new bytes source with an explicit offset.

When this function is used to create a bytes source, Source::pos will report a value increates by offset.

Returns the remaining length of data.

Returns whether there is any data remaining.

Splits the first len bytes off the source and returns them.

Panics

This method panics of len is larger than self.len().

Converts the source into the remaining bytes.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The error produced when the source failed to read more data.

Returns the current logical postion within the sequence of data.

Request at least len bytes to be available. Read more

Returns a bytes slice with the available data. Read more

Produces a Bytes value from part of the data. Read more

Advance the source by len bytes. Read more

Skip over the next len bytes. Read more

Takes a single octet from the source. Read more

Takes an optional octet from the source. Read more

Returns a content error at the current position of the source.

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

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.