Enum postcard_cobs::DecoderState[][src]

pub enum DecoderState {
    Idle,
    Grab(u8),
    GrabChain(u8),
}
Expand description

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

Variants

Idle

State machine has not received any non-zero bytes

Grab

1-254 bytes, can be header or 00

Tuple Fields of Grab

0: u8
GrabChain

255 bytes, will be a header next

Tuple Fields of GrabChain

0: u8

Implementations

Push a single encoded byte into the state machine. If the input was unexpected, such as an early end of a framed message segment, an Error will be returned, and the current associated output buffer contents should be discarded.

If a complete message is indicated, the decoding state machine will automatically reset itself to the Idle state, and may be used to begin decoding another message.

NOTE: Sentinel value must be included in the input to this function for the decoding to complete

Trait Implementations

Formats the value using the given formatter. Read more

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.