[−][src]Enum postcard_cobs::DecoderState
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(u8)
1-254 bytes, can be header or 00
GrabChain(u8)
255 bytes, will be a header next
Methods
impl DecoderState
[src]
pub fn feed(&mut self, data: u8) -> Result<DecodeResult, ()>
[src]
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
Auto Trait Implementations
impl Send for DecoderState
impl Sync for DecoderState
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,