Struct tockloader_proto::ResponseDecoder
[−]
[src]
pub struct ResponseDecoder { /* fields omitted */ }The ResponseDecoder takes bytes and gives you Responsess.
Methods
impl ResponseDecoder[src]
fn new() -> ResponseDecoder[src]
Create a new ResponseDecoder.
The decoder is fed bytes with the receive method.
fn reset(&mut self)[src]
Empty the RX buffer.
fn receive(&mut self, ch: u8) -> Result<Option<Response>, Error>[src]
Process incoming bytes.
The decoder is fed bytes with the receive method. If not enough
bytes have been seen, this function returns None. Once enough bytes
have been seen, it returns Some(Response) containing the
decoded Response.
fn set_payload_len(&mut self, length: usize) -> Result<(), Error>[src]
Set the expected length of an unbounded message. This depends entirely on the last command you sent.