Struct postcard_cobs::EncoderState[][src]

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

The EncoderState is used to track the current state of a streaming encoder. This struct does not contain the output buffer (or a reference to one), and can be used when streaming the encoded output to a custom data type

IMPORTANT NOTE: When implementing a custom streaming encoder, the EncoderState state machine assumes that the output buffer ALREADY contains a single placeholder byte, and no other bytes. This placeholder byte will be later modified with the first distance to the next header/zero byte.

Implementations

Push a single unencoded byte into the encoder state machine

Finalize the encoding process for a single message. The byte at the given index should be replaced with the given value, and the sentinel value (typically 0u8) must be inserted at the current end of the output buffer, serving as a framing byte.

Trait Implementations

Formats the value using the given formatter. Read more

Create a default initial state representation for a COBS encoder

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 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.