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

Used to decoded messages from several/partial data chunks

Implementations

Tries to decode data without reserve any memory, direcly from data. decoded_callback will be called for each decoded message. If data is not enough to decoding a message, the data will be stored until more data is decoded (more successives calls to this function).

Returns the bytes len stored in this decoder. It can include both, the padding bytes and the data message bytes. After decoding a message, its bytes are removed from the decoder.

Trait Implementations

Creates a new decoder. It will only reserve memory in cases where decoding needs to keep data among messages.

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.

Should always be Self

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.