Enum postcard_cobs::DecoderState [−][src]
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
State machine has not received any non-zero bytes
1-254 bytes, can be header or 00
Tuple Fields of Grab
0: u8
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