pub struct Parser { /* private fields */ }
Expand description
Parses NMEA sentences and stores intermediate parsing state. Parser is tolerant for errors so you should not reinitialize it after errors.
Implementations§
source§impl Parser
impl Parser
sourcepub fn source_only(self, source: Source) -> Self
pub fn source_only(self, source: Source) -> Self
Accepts only that source
sourcepub fn source_filter(self, source_mask: SourceMask) -> Self
pub fn source_filter(self, source_mask: SourceMask) -> Self
Ignore all sources except given.
sourcepub fn sentence_only(self, sentence: Sentence) -> Self
pub fn sentence_only(self, sentence: Sentence) -> Self
Accepts only that sentence
sourcepub fn sentence_filter(self, sentence_mask: SentenceMask) -> Self
pub fn sentence_filter(self, sentence_mask: SentenceMask) -> Self
Ignore all sentences except given.
sourcepub fn parse_from_bytes<'a>(
&'a mut self,
input: &'a [u8]
) -> impl Iterator<Item = Result<ParseResult, &'static str>> + 'a
pub fn parse_from_bytes<'a>( &'a mut self, input: &'a [u8] ) -> impl Iterator<Item = Result<ParseResult, &'static str>> + 'a
Use parser state and bytes slice than returns Iterator that yield ParseResult or errors if has enough data for parsing.
sourcepub fn parse_from_byte(
&mut self,
symbol: u8
) -> Option<Result<ParseResult, &'static str>>
pub fn parse_from_byte( &mut self, symbol: u8 ) -> Option<Result<ParseResult, &'static str>>
Parse NMEA by one byte at a time. Returns Some if has enough data for parsing.
Auto Trait Implementations§
impl RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnwindSafe for Parser
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