Struct cni_format::CniParser[][src]

pub struct CniParser<'source> { /* fields omitted */ }

An iterator that visits all key/value pairs in declaration order, even key/value pairs that will be overwritten by later statements.

Calling next on this iterator after receiving a Some(Err(_)) causes undefined behaviour.

If you just want to access the resulting key/value store, take a look at from_str.

Implementations

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

#[must_use = "iterators are lazy and do nothing unless consumed"]pub fn new(source: &'a str) -> Self[src]

Creates a new CniParser that will parse the given CNI format text.

Trait Implementations

impl<'a> From<&'a str> for CniParser<'a>[src]

fn from(text: &'a str) -> CniParser<'a>

Notable traits for CniParser<'_>

impl Iterator for CniParser<'_> type Item = Result<(String, String), &'static str>;
[src]

Create a CniParser from a string slice.

impl Iterator for CniParser<'_>[src]

type Item = Result<(String, String), &'static str>

The type of the elements being iterated over.

fn next(&mut self) -> Option<Self::Item>[src]

Try to parse until the next key/value pair.

Auto Trait Implementations

impl<'source> RefUnwindSafe for CniParser<'source>

impl<'source> Send for CniParser<'source>

impl<'source> Sync for CniParser<'source>

impl<'source> Unpin for CniParser<'source>

impl<'source> UnwindSafe for CniParser<'source>

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, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

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.