Struct multiwii_serial_protocol::MspParser
[−]
[src]
pub struct MspParser { /* fields omitted */ }
Parser that can find packets from a raw byte stream
Methods
impl MspParser
[src]
fn new() -> MspParser
[src]
Create a new parser
fn state_is_between_packets(&self) -> bool
[src]
Are we waiting for the header of a brand new packet?
fn parse<'b>(
&mut self,
input: u8
) -> Result<Option<MspPacket<'b>>, MspPacketParseError>
[src]
&mut self,
input: u8
) -> Result<Option<MspPacket<'b>>, MspPacketParseError>
Parse the next input byte. Returns a valid packet whenever a full packet is received, otherwise restarts the state of the parser.