pub struct CounterPacker<P: Packer> { /* private fields */ }
Expand description

A Packer able to keep count of the number of written bytes.

Implementations

Creates a new CounterPacker.

Returns the number of written bytes.

Consumes the value to return the inner Packer.

Trait Implementations

An error type representing any error related to writing bytes.

Writes a sequence of bytes into the Packer. The totality of bytes must be written into the packer. This method must fail if the packer does not have enough space to fulfill the request. Read more

Returns the exact number of written 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.