Struct nmea0183::Parser

source ·
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

source

pub fn new() -> Parser

Constructs new Parser.

source

pub fn source_only(self, source: Source) -> Self

Accepts only that source

source

pub fn source_filter(self, source_mask: SourceMask) -> Self

Ignore all sources except given.

source

pub fn sentence_only(self, sentence: Sentence) -> Self

Accepts only that sentence

source

pub fn sentence_filter(self, sentence_mask: SentenceMask) -> Self

Ignore all sentences except given.

source

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.

source

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§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.