Struct segsource::BytesSource[][src]

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

A U8Source that uses a Bytes object from the wonderful bytes crate to store its underlying data. This source can only use u8s as its item.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Performs the conversion.

The type of item the Source and its generated Segments will hold.

The initial offset of the Source. For more information, see the Offsets section of the Source documentation. Read more

The amount of data in the reader. If the reader’s size changes (which none of the implementations currently do), then this should return how much data was initially in the reader. Read more

Creates a new source with the provided initial offset, using the items in theVec for its data. Read more

Creates a segment from the start offset (inclusive) to the end offset (exclusive).

Creates a new source using the data in the Vec for its data.

Checks to make sure that the provided offset is valid. If it is, then an Ok(()) will be returned. Otherwise, the appropriate error will be returned. Read more

Returns a single segment containing all data in the source.

Gets a segment of n items, starting at the given offset.

Gets all items in the source before the provided offset (exclusive).

Gets all items in the source after the provided offset (inclusive).

The lowest valid offset that can be requested.

The highest valid offset that can be requested.

Creates a new source using the the provided file, Endidness, and offset.

An async version of U8Source::from_file_with_offset.

Creates a new source using the the provided Bytes, Endidness, and offset.

The endidness of the source.

Changes the default endidness. This does not change the endidness for any Segments that have already been created, but only for Segments that are created in the future. Read more

Creates a new source using the the provided vec, Endidness, and offset.

Creates a new source using the the provided slice, Endidness, and offset. Read more

Creates a new source using the the provided slice and Endidness. Read more

Creates a new source using the the provided vec and Endidness.

Creates a new source using the the provided file and Endidness.

An async version of U8Source::from_file.

Creates a new source using the the provided Bytes and Endidness.

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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.