Struct gv100ad::parser::FieldReader[][src]

pub struct FieldReader<'a> { /* fields omitted */ }

Reader to read fields from a single data record (i.e. line). Specifically this makes sure that data is read correctly as UTF-8.

Implementations

impl<'a> FieldReader<'a>[src]

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

Creates a new field reader from a single line. It expects the line to not contain any line terminator.

pub fn next(&mut self, n: usize) -> &str[src]

Reads a field of length n as string. n is in characters, not bytes.

pub fn next_opt(&mut self, n: usize) -> Option<&str>[src]

pub fn parse_next<T: FromStr>(
    &mut self,
    n: usize
) -> Result<T, <T as FromStr>::Err>
[src]

Reads a field of length n and parses it as T.

pub fn parse_next_opt<T: FromStr>(
    &mut self,
    n: usize
) -> Result<Option<T>, <T as FromStr>::Err>
[src]

pub fn skip(&mut self, n: usize)[src]

Skips n characters.

Auto Trait Implementations

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> UnwindSafe for FieldReader<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.