pub struct NmeaParser {}Expand description
Main NMEA parser structure (now stateless)
Implementations§
Source§impl NmeaParser
impl NmeaParser
Sourcepub fn parse_bytes(
&self,
data: &[u8],
) -> Result<(Option<NmeaMessage>, usize), (ParseError, usize)>
pub fn parse_bytes( &self, data: &[u8], ) -> Result<(Option<NmeaMessage>, usize), (ParseError, usize)>
Parse multiple bytes and return a parsed message if found, along with bytes consumed
Returns:
- Ok((Some(message), bytes_consumed)) - Successfully parsed a complete message
- Ok((None, bytes_consumed)) - Partial message, need more data (bytes_consumed will be 0 if no $ found)
- Err((ParseError, bytes_consumed)) - Found complete message but it’s invalid
The parser handles spurious characters before the ‘$’ start marker by consuming them.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NmeaParser
impl RefUnwindSafe for NmeaParser
impl Send for NmeaParser
impl Sync for NmeaParser
impl Unpin for NmeaParser
impl UnwindSafe for NmeaParser
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more