[][src]Trait combinedfun::ParserImpl

pub trait ParserImpl<I> {
    type Output;
    type Error;
    fn apply(&self, inp: I) -> Result<(I, Self::Output), Self::Error>;
}

This trait has to be implemented for the combinators in combinators to provide the basic functionality required for Parser.

Associated Types

type Output

The output type of the parser

type Error

The error type of the parser

Loading content...

Required methods

fn apply(&self, inp: I) -> Result<(I, Self::Output), Self::Error>

This runs the parser. It receives an input, returns the input that hasn't been read yet and the output attached to what was read until that point. If it fails, it returns its error type.

Loading content...

Implementors

impl<F, I, O, E> ParserImpl<I> for F where
    F: Fn(I) -> Result<(I, O), E>, 
[src]

type Output = O

type Error = E

impl<I, A, B> ParserImpl<I> for Or<A, B> where
    I: Clone,
    A: ParserImpl<I>,
    B: ParserImpl<I, Output = A::Output, Error = A::Error>,
    A::Error: AltError<I>, 
[src]

type Output = A::Output

type Error = A::Error

impl<I, A, B> ParserImpl<I> for Then<A, B> where
    A: ParserImpl<I>,
    B: ParserImpl<I, Error = A::Error>, 
[src]

type Output = (A::Output, B::Output)

type Error = A::Error

impl<I, CG, C, R, F1, F2> ParserImpl<I> for CountedSeparated<CG, R, F1, F2> where
    I: Clone,
    C: Collection<Item = F1::Output>,
    R: RangeLike,
    F1: ParserImpl<I>,
    F2: ParserImpl<I, Error = F1::Error>,
    CG: Fn() -> C, 
[src]

type Output = (C, usize)

type Error = F1::Error

impl<I, E> ParserImpl<I> for Epsilon<E>[src]

type Output = ()

type Error = E

impl<I, F1, F2, O> ParserImpl<I> for Map<F1, F2> where
    F1: ParserImpl<I>,
    F2: Fn(F1::Output) -> O, 
[src]

type Output = O

type Error = F1::Error

impl<I, F1, F2, O> ParserImpl<I> for MapResult<F1, F2> where
    F1: ParserImpl<I>,
    F2: Fn(F1::Output) -> Result<O, F1::Error>, 
[src]

type Output = O

type Error = F1::Error

impl<I, O1, O2, F> ParserImpl<I> for MapLeft<F> where
    F: ParserImpl<I, Output = (O1, O2)>, 
[src]

type Output = O1

type Error = F::Error

impl<I, O1, O2, F> ParserImpl<I> for MapRight<F> where
    F: ParserImpl<I, Output = (O1, O2)>, 
[src]

type Output = O2

type Error = F::Error

Loading content...