[][src]Struct cfg_lib::config::Parser

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

This implements the low-level parser of CFG source text.

Methods

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

pub fn new(r: Box<dyn Read + 'a>) -> StdResult<Self, RecognizerError>[src]

Return a new instance of the parser using the provided reader for the source text. The first token is read.

pub fn at_end(&self) -> bool[src]

Return true if the parser has reached the end of the source, else false.

pub fn location(&self) -> Location[src]

Return the current location of the parser in the source.

pub fn container(&mut self) -> StdResult<ASTValue, RecognizerError>[src]

Parse the contents of a configuration, which should be a mapping or a list, and return the parsed value or a syntax error.

pub fn expr(&mut self) -> StdResult<ASTValue, RecognizerError>[src]

Parse an expression and return an AST node representing it, or a syntax error.

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Parser<'a>

impl<'a> !Send for Parser<'a>

impl<'a> !Sync for Parser<'a>

impl<'a> Unpin for Parser<'a>

impl<'a> !UnwindSafe for Parser<'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, 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.