Skip to main content

Parser

Trait Parser 

Source
pub trait Parser<I: Input> {
    type Output;
    type Error;

    // Required method
    fn parse_next(
        &mut self,
        input: &mut I,
    ) -> PResult<Self::Output, Self::Error>;
}

Required Associated Types§

Required Methods§

Source

fn parse_next(&mut self, input: &mut I) -> PResult<Self::Output, Self::Error>

Implementations on Foreign Types§

Source§

impl<I: Input, P: Parser<I> + ?Sized> Parser<I> for Box<P>

Source§

type Error = <P as Parser<I>>::Error

Source§

type Output = <P as Parser<I>>::Output

Source§

fn parse_next(&mut self, input: &mut I) -> PResult<Self::Output, Self::Error>

Implementors§

Source§

impl Parser<StrInput<'_>> for Char

Source§

impl Parser<StrInput<'_>> for Tag

Source§

impl<'a> Parser<StrInput<'a>> for Identifier

Source§

impl<'a> Parser<StrInput<'a>> for Integer

Source§

impl<'a> Parser<StrInput<'a>> for QuotedString

Source§

impl<'a, F> Parser<StrInput<'a>> for Escaped<F>
where F: FnMut(char) -> Option<char>,

Source§

impl<'a, I: Input, O, E> Parser<I> for Recursive<'a, I, O, E>

Source§

type Error = E

Source§

type Output = O

Source§

impl<'s, I: Input> Parser<I> for NoneOf<'s, I>

Source§

impl<'s, I: Input> Parser<I> for OneOf<'s, I>

Source§

impl<I, O, E, F> Parser<I> for FnParser<F>
where I: Input, F: FnMut(&mut I) -> PResult<O, E>,

Source§

type Error = E

Source§

type Output = O

Source§

impl<I, P1, P2> Parser<I> for Or<P1, P2>
where I: Input, P1: Parser<I>, P1::Error: MergeError, P2: Parser<I, Output = P1::Output, Error = P1::Error>,

Source§

type Error = <P1 as Parser<I>>::Error

Source§

type Output = <P1 as Parser<I>>::Output

Source§

impl<I, P1, P2> Parser<I> for Zip<P1, P2>
where I: Input, P1: Parser<I>, P2: Parser<I, Error = P1::Error>,

Source§

type Error = <P1 as Parser<I>>::Error

Source§

type Output = (<P1 as Parser<I>>::Output, <P2 as Parser<I>>::Output)

Source§

impl<I, P1, P2> Parser<I> for ZipLeft<P1, P2>
where I: Input, P1: Parser<I>, P2: Parser<I, Error = P1::Error>,

Source§

type Error = <P1 as Parser<I>>::Error

Source§

type Output = <P1 as Parser<I>>::Output

Source§

impl<I, P1, P2> Parser<I> for ZipRight<P1, P2>
where I: Input, P1: Parser<I>, P2: Parser<I, Error = P1::Error>,

Source§

type Error = <P1 as Parser<I>>::Error

Source§

type Output = <P2 as Parser<I>>::Output

Source§

impl<I, P> Parser<I> for Attempt<P>
where I: Input, P: Parser<I>,

Source§

type Error = <P as Parser<I>>::Error

Source§

type Output = <P as Parser<I>>::Output

Source§

impl<I, P> Parser<I> for Context<P>
where I: Input, P: Parser<I>, P::Error: ContextError,

Source§

type Error = <P as Parser<I>>::Error

Source§

type Output = <P as Parser<I>>::Output

Source§

impl<I, P> Parser<I> for Cut<P>
where I: Input, P: Parser<I>,

Source§

type Error = <P as Parser<I>>::Error

Source§

type Output = <P as Parser<I>>::Output

Source§

impl<I, P> Parser<I> for Many1<P>
where I: Input, P: Parser<I>,

Source§

type Error = <P as Parser<I>>::Error

Source§

type Output = Vec<<P as Parser<I>>::Output>

Source§

impl<I, P> Parser<I> for Many<P>
where I: Input, P: Parser<I>,

Source§

type Error = <P as Parser<I>>::Error

Source§

type Output = Vec<<P as Parser<I>>::Output>

Source§

impl<I, P> Parser<I> for Optional<P>
where I: Input, P: Parser<I>,

Source§

type Error = <P as Parser<I>>::Error

Source§

type Output = Option<<P as Parser<I>>::Output>

Source§

impl<I, P, B, F, Acc> Parser<I> for Many1Fold<P, B, F>
where I: Input, P: Parser<I>, B: FnMut() -> Acc, F: FnMut(Acc, P::Output) -> Acc,

Source§

type Error = <P as Parser<I>>::Error

Source§

type Output = Acc

Source§

impl<I, P, B, F, Acc> Parser<I> for ManyFold<P, B, F>
where I: Input, P: Parser<I>, B: FnMut() -> Acc, F: FnMut(Acc, P::Output) -> Acc,

Source§

type Error = <P as Parser<I>>::Error

Source§

type Output = Acc

Source§

impl<I, P, F, O2> Parser<I> for Map<P, F>
where I: Input, P: Parser<I>, F: FnMut(P::Output) -> O2,

Source§

type Error = <P as Parser<I>>::Error

Source§

type Output = O2

Source§

impl<I, P, F, O2, E2> Parser<I> for MapRes<P, F>
where I: Input, P: Parser<I, Error = ParseError>, F: FnMut(P::Output) -> Result<O2, E2>,

Source§

impl<I, P, F, P2> Parser<I> for FlatMap<P, F>
where I: Input, P: Parser<I>, P2: Parser<I, Error = P::Error>, F: FnMut(P::Output) -> P2,

Source§

type Error = <P as Parser<I>>::Error

Source§

type Output = <P2 as Parser<I>>::Output

Source§

impl<I, P, Op, F> Parser<I> for ChainL1<P, Op>
where I: Input, P: Parser<I>, Op: Parser<I, Output = F, Error = P::Error>, F: FnMut(P::Output, P::Output) -> P::Output,

Source§

type Error = <P as Parser<I>>::Error

Source§

type Output = <P as Parser<I>>::Output

Source§

impl<I, P, Op, F> Parser<I> for ChainR1<P, Op>
where I: Input, P: Parser<I>, Op: Parser<I, Output = F, Error = P::Error>, F: FnMut(P::Output, P::Output) -> P::Output,

Source§

type Error = <P as Parser<I>>::Error

Source§

type Output = <P as Parser<I>>::Output

Source§

impl<I, P, S> Parser<I> for SepBy0<P, S>
where I: Input, P: Parser<I>, S: Parser<I, Error = P::Error>,

Source§

type Error = <P as Parser<I>>::Error

Source§

type Output = Vec<<P as Parser<I>>::Output>

Source§

impl<I, P, S> Parser<I> for SepBy1<P, S>
where I: Input, P: Parser<I>, S: Parser<I, Error = P::Error>,

Source§

type Error = <P as Parser<I>>::Error

Source§

type Output = Vec<<P as Parser<I>>::Output>

Source§

impl<I, P, S, B, F, Acc> Parser<I> for SepByFold0<P, S, B, F>
where I: Input, P: Parser<I>, S: Parser<I, Error = P::Error>, B: FnMut() -> Acc, F: FnMut(Acc, P::Output) -> Acc,

Source§

type Error = <P as Parser<I>>::Error

Source§

type Output = Acc

Source§

impl<I, P, S, B, F, Acc> Parser<I> for SepByFold1<P, S, B, F>
where I: Input, P: Parser<I>, S: Parser<I, Error = P::Error>, B: FnMut() -> Acc, F: FnMut(Acc, P::Output) -> Acc,

Source§

type Error = <P as Parser<I>>::Error

Source§

type Output = Acc

Source§

impl<I: Input> Parser<I> for Eof<I>

Source§

impl<I: Input> Parser<I> for Take<I>

Source§

impl<I: Input, F> Parser<I> for Satisfy<F, I>
where F: FnMut(I::Token) -> bool,

Source§

impl<I: Input, F> Parser<I> for TakeTill0<F, I>
where F: FnMut(I::Token) -> bool,

Source§

impl<I: Input, F> Parser<I> for TakeTill1<F, I>
where F: FnMut(I::Token) -> bool,

Source§

impl<I: Input, F> Parser<I> for TakeWhile0<F, I>
where F: FnMut(I::Token) -> bool,

Source§

impl<I: Input, F> Parser<I> for TakeWhile1<F, I>
where F: FnMut(I::Token) -> bool,

Source§

impl<I: Input, F> Parser<I> for TakeWhileNM<F, I>
where F: FnMut(I::Token) -> bool,