Skip to main content

FieldReader

Struct FieldReader 

Source
pub struct FieldReader<'a> { /* private fields */ }
Expand description

Sequential field reader for NMEA sentence parsing.

Wraps a slice of &str fields and reads them in order, advancing an internal index after each read.

Implementations§

Source§

impl<'a> FieldReader<'a>

Source

pub fn new(fields: &'a [&'a str]) -> Self

Source

pub fn f32(&mut self) -> Option<f32>

Read an optional f32 and advance.

Source

pub fn f64(&mut self) -> Option<f64>

Read an optional f64 and advance.

Source

pub fn u8(&mut self) -> Option<u8>

Read an optional u8 and advance.

Source

pub fn u32(&mut self) -> Option<u32>

Read an optional u32 and advance.

Source

pub fn i8(&mut self) -> Option<i8>

Read an optional i8 and advance.

Source

pub fn char(&mut self) -> Option<char>

Read an optional single character and advance.

Source

pub fn string(&mut self) -> Option<String>

Read an optional non-empty string and advance.

Source

pub fn skip(&mut self)

Skip one field (fixed indicator) and advance.

Auto Trait Implementations§

§

impl<'a> Freeze for FieldReader<'a>

§

impl<'a> RefUnwindSafe for FieldReader<'a>

§

impl<'a> Send for FieldReader<'a>

§

impl<'a> Sync for FieldReader<'a>

§

impl<'a> Unpin for FieldReader<'a>

§

impl<'a> UnsafeUnpin for FieldReader<'a>

§

impl<'a> UnwindSafe for FieldReader<'a>

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>,

Source§

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>,

Source§

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.