Struct wire_rs::VectoredReader

source ·
pub struct VectoredReader<'a, const E: bool = true> { /* private fields */ }
Expand description

A wrapper around a slice of &[u8] slices that provides an easy interface for reading data types from the vectored slices.

Implementations§

Create a VectoredReader that can read data types sequentially from the vectored slices bytes.

Advance the reader’s index forward by the given amount of bytes, returning an error if there are insufficient bytes on the wire to do so.

Advance the reader’s index forward by the given number of bytes, or to the end of the wire if the amount exceeds the number of remaining bytes.

Check if the reader has no more bytes left on the vectored wire that can be read. If any bytes remain, return WireError::ExtraBytes; otherwise, return Ok().

Check if the reader has no more bytes left on the vectored wire that can be read after the given action. If any bytes remain, return WireError::ExtraBytes; otherwise, return Ok().

Check whether the reader has any remaining bytes to be read.

Read the given data type T from the vectored wire without advancing the index of the reader.

Read the given data type T from the vectored wire without advancing the index of the reader.

Read the given data type T from L bytes on the vectored wire without advancing the index of the reader.

Read the given data type T from size bytes on the vectored wire without advancing the index of the reader.

Read the given data type T from the vectored wire.

Read the given data type T from the vectored wire.

Read the given data type T from size bytes on the vectored wire.

Read the given data type T from the vectored wire.

Read the given data type T from the remaining data on the vectored wire. Note that this operation may succeed even if there are no bytes remaining on the vectored wire for the given reader.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Converts to this type from the input type.

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.