pub struct CounterUnpacker<U: Unpacker> { /* private fields */ }
Expand description

An Unpacker able to keep count of the number of read bytes.

Implementations

Creates a new CounterUnpacker.

Returns the number of read bytes.

Consumes the value to return the inner Unpacker.

Trait Implementations

An error type representing any error related to reading bytes.

Reads a sequence of bytes from the Unpacker. This sequence must be long enough to fill bytes completely. This method must fail if the unpacker does not have enough bytes to fulfill the request. Read more

Tries to guarantee that the Unpacker has at least len bytes. Read more

Returns the exact number of read bytes if possible.

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.