DocumentParser

Trait DocumentParser 

Source
pub trait DocumentParser<'doc> {
    type Output;
    type Error;

    // Required method
    fn parse(
        &mut self,
        ctx: &ParseContext<'doc>,
    ) -> Result<Self::Output, Self::Error>;
}

Required Associated Types§

Required Methods§

Source

fn parse( &mut self, ctx: &ParseContext<'doc>, ) -> Result<Self::Output, Self::Error>

Implementors§

Source§

impl<'doc> DocumentParser<'doc> for VariantLiteralParser

Source§

impl<'doc, T, E> DocumentParser<'doc> for AlwaysParser<T, E>
where T: Clone,

Source§

type Output = T

Source§

type Error = E

Source§

impl<'doc, T, E> DocumentParser<'doc> for LiteralParser<T>
where T: ParseDocument<'doc, Error = E> + PartialEq + Debug, E: From<ParseError>,

Source§

type Output = T

Source§

type Error = E

Source§

impl<'doc, T, F, E> DocumentParser<'doc> for F
where F: FnMut(&ParseContext<'doc>) -> Result<T, E>,

Source§

type Output = T

Source§

type Error = E

Source§

impl<'doc, T, O, F> DocumentParser<'doc> for MapParser<T, F>
where T: DocumentParser<'doc>, F: FnMut(T::Output) -> O,

Source§

type Output = O

Source§

type Error = <T as DocumentParser<'doc>>::Error

Source§

impl<'doc, T, O, F, E> DocumentParser<'doc> for AndThenParser<T, F>
where T: DocumentParser<'doc, Error = E>, F: Fn(T::Output) -> Result<O, E>,

Source§

type Output = O

Source§

type Error = E