Parser

Trait Parser 

Source
pub trait Parser<'a, I: ?Sized, O, E: ParserError, ParserType> {
    // Required method
    fn fab(&self, input: &mut &'a I) -> Result<O, E>;

    // Provided methods
    fn fab_value<V: Clone>(self, value: V) -> Value<Self, V, I, O, E>
       where Self: Sized { ... }
    fn fab_map<F>(self, func: F) -> ParserMap<Self, I, O, E, F>
       where Self: Sized { ... }
    fn fab_try_map<F>(self, func: F) -> ParserTryMap<Self, I, O, E, F>
       where Self: Sized { ... }
    fn fab_repeat(self) -> Repeat<Self, I, O, E, fn(&mut Vec<O>, O), Vec<O>>
       where Self: Sized,
             O: Clone { ... }
}

Required Methods§

Source

fn fab(&self, input: &mut &'a I) -> Result<O, E>

Parses the input. This method advances the input reference to the remaining unparsed input. The method is named “fab” instead of “parse” to avoid conflicts with the “parse” method of &str.

Provided Methods§

Source

fn fab_value<V: Clone>(self, value: V) -> Value<Self, V, I, O, E>
where Self: Sized,

Returns a parser that replaces the output of the underlying parser with V.

Source

fn fab_map<F>(self, func: F) -> ParserMap<Self, I, O, E, F>
where Self: Sized,

This creates a Map parser that applies the function to the output of the underlying parser.

Source

fn fab_try_map<F>(self, func: F) -> ParserTryMap<Self, I, O, E, F>
where Self: Sized,

This parser first maps the input, and if the result is Option::Some or Result::Ok, it unwraps the input. Othewise, the parser fails.

Source

fn fab_repeat(self) -> Repeat<Self, I, O, E, fn(&mut Vec<O>, O), Vec<O>>
where Self: Sized, O: Clone,

Repeats the underlying parser, returning the results in a Vec. This parser will accept any number of repetitions, including 0.

The repeat method has some methods to modify its behavior, which can be composed with each other. See the Repeat struct for these emthods.

Implementations on Foreign Types§

Source§

impl<'a, E, Item, const N: usize> Parser<'a, [Item], &'a [Item], E, ConstArrayParser> for [Item; N]
where E: ParserError, Item: Clone + PartialEq,

Source§

fn fab(&self, input: &mut &'a [Item]) -> Result<&'a [Item], E>

Source§

impl<'a, I, E> Parser<'a, I, &'a I, E, SeqSeqParser> for &I
where I: ?Sized + Sequence + PartialEq, E: ParserError,

Source§

fn fab(&self, input: &mut &'a I) -> Result<&'a I, E>

Source§

impl<'a, I: ?Sized + Sequence, O1, E: ParserError, P1, T1> Parser<'a, I, (O1,), E, Seq1<T1>> for (P1,)
where P1: Parser<'a, I, O1, E, T1>,

Source§

fn fab(&self, input: &mut &'a I) -> Result<(O1,), E>

Source§

impl<'a, I: ?Sized + Sequence, O1, O2, E: ParserError, P1, T1, P2, T2> Parser<'a, I, (O1, O2), E, Seq2<T1, T2>> for (P1, P2)
where P1: Parser<'a, I, O1, E, T1>, P2: Parser<'a, I, O2, E, T2>,

Source§

fn fab(&self, input: &mut &'a I) -> Result<(O1, O2), E>

Source§

impl<'a, I: ?Sized + Sequence, O1, O2, O3, E: ParserError, P1, T1, P2, T2, P3, T3> Parser<'a, I, (O1, O2, O3), E, Seq3<T1, T2, T3>> for (P1, P2, P3)
where P1: Parser<'a, I, O1, E, T1>, P2: Parser<'a, I, O2, E, T2>, P3: Parser<'a, I, O3, E, T3>,

Source§

fn fab(&self, input: &mut &'a I) -> Result<(O1, O2, O3), E>

Source§

impl<'a, I: ?Sized + Sequence, O1, O2, O3, O4, E: ParserError, P1, T1, P2, T2, P3, T3, P4, T4> Parser<'a, I, (O1, O2, O3, O4), E, Seq4<T1, T2, T3, T4>> for (P1, P2, P3, P4)
where P1: Parser<'a, I, O1, E, T1>, P2: Parser<'a, I, O2, E, T2>, P3: Parser<'a, I, O3, E, T3>, P4: Parser<'a, I, O4, E, T4>,

Source§

fn fab(&self, input: &mut &'a I) -> Result<(O1, O2, O3, O4), E>

Source§

impl<'a, I: ?Sized + Sequence, O1, O2, O3, O4, O5, E: ParserError, P1, T1, P2, T2, P3, T3, P4, T4, P5, T5> Parser<'a, I, (O1, O2, O3, O4, O5), E, Seq5<T1, T2, T3, T4, T5>> for (P1, P2, P3, P4, P5)
where P1: Parser<'a, I, O1, E, T1>, P2: Parser<'a, I, O2, E, T2>, P3: Parser<'a, I, O3, E, T3>, P4: Parser<'a, I, O4, E, T4>, P5: Parser<'a, I, O5, E, T5>,

Source§

fn fab(&self, input: &mut &'a I) -> Result<(O1, O2, O3, O4, O5), E>

Source§

impl<'a, I: ?Sized + Sequence, O1, O2, O3, O4, O5, O6, E: ParserError, P1, T1, P2, T2, P3, T3, P4, T4, P5, T5, P6, T6> Parser<'a, I, (O1, O2, O3, O4, O5, O6), E, Seq6<T1, T2, T3, T4, T5, T6>> for (P1, P2, P3, P4, P5, P6)
where P1: Parser<'a, I, O1, E, T1>, P2: Parser<'a, I, O2, E, T2>, P3: Parser<'a, I, O3, E, T3>, P4: Parser<'a, I, O4, E, T4>, P5: Parser<'a, I, O5, E, T5>, P6: Parser<'a, I, O6, E, T6>,

Source§

fn fab(&self, input: &mut &'a I) -> Result<(O1, O2, O3, O4, O5, O6), E>

Source§

impl<'a, I: ?Sized + Sequence, O1, O2, O3, O4, O5, O6, O7, E: ParserError, P1, T1, P2, T2, P3, T3, P4, T4, P5, T5, P6, T6, P7, T7> Parser<'a, I, (O1, O2, O3, O4, O5, O6, O7), E, Seq7<T1, T2, T3, T4, T5, T6, T7>> for (P1, P2, P3, P4, P5, P6, P7)
where P1: Parser<'a, I, O1, E, T1>, P2: Parser<'a, I, O2, E, T2>, P3: Parser<'a, I, O3, E, T3>, P4: Parser<'a, I, O4, E, T4>, P5: Parser<'a, I, O5, E, T5>, P6: Parser<'a, I, O6, E, T6>, P7: Parser<'a, I, O7, E, T7>,

Source§

impl<'a, I: ?Sized + Sequence, O1, O2, O3, O4, O5, O6, O7, O8, E: ParserError, P1, T1, P2, T2, P3, T3, P4, T4, P5, T5, P6, T6, P7, T7, P8, T8> Parser<'a, I, (O1, O2, O3, O4, O5, O6, O7, O8), E, Seq8<T1, T2, T3, T4, T5, T6, T7, T8>> for (P1, P2, P3, P4, P5, P6, P7, P8)
where P1: Parser<'a, I, O1, E, T1>, P2: Parser<'a, I, O2, E, T2>, P3: Parser<'a, I, O3, E, T3>, P4: Parser<'a, I, O4, E, T4>, P5: Parser<'a, I, O5, E, T5>, P6: Parser<'a, I, O6, E, T6>, P7: Parser<'a, I, O7, E, T7>, P8: Parser<'a, I, O8, E, T8>,

Source§

impl<'a, I: ?Sized + Sequence, O1, O2, O3, O4, O5, O6, O7, O8, O9, E: ParserError, P1, T1, P2, T2, P3, T3, P4, T4, P5, T5, P6, T6, P7, T7, P8, T8, P9, T9> Parser<'a, I, (O1, O2, O3, O4, O5, O6, O7, O8, O9), E, Seq9<T1, T2, T3, T4, T5, T6, T7, T8, T9>> for (P1, P2, P3, P4, P5, P6, P7, P8, P9)
where P1: Parser<'a, I, O1, E, T1>, P2: Parser<'a, I, O2, E, T2>, P3: Parser<'a, I, O3, E, T3>, P4: Parser<'a, I, O4, E, T4>, P5: Parser<'a, I, O5, E, T5>, P6: Parser<'a, I, O6, E, T6>, P7: Parser<'a, I, O7, E, T7>, P8: Parser<'a, I, O8, E, T8>, P9: Parser<'a, I, O9, E, T9>,

Source§

impl<'a, I: ?Sized + Sequence, O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, E: ParserError, P1, T1, P2, T2, P3, T3, P4, T4, P5, T5, P6, T6, P7, T7, P8, T8, P9, T9, P10, T10> Parser<'a, I, (O1, O2, O3, O4, O5, O6, O7, O8, O9, O10), E, Seq10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>> for (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10)
where P1: Parser<'a, I, O1, E, T1>, P2: Parser<'a, I, O2, E, T2>, P3: Parser<'a, I, O3, E, T3>, P4: Parser<'a, I, O4, E, T4>, P5: Parser<'a, I, O5, E, T5>, P6: Parser<'a, I, O6, E, T6>, P7: Parser<'a, I, O7, E, T7>, P8: Parser<'a, I, O8, E, T8>, P9: Parser<'a, I, O9, E, T9>, P10: Parser<'a, I, O10, E, T10>,

Source§

impl<'a, I: ?Sized + Sequence, O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11, E: ParserError, P1, T1, P2, T2, P3, T3, P4, T4, P5, T5, P6, T6, P7, T7, P8, T8, P9, T9, P10, T10, P11, T11> Parser<'a, I, (O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11), E, Seq11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>> for (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11)
where P1: Parser<'a, I, O1, E, T1>, P2: Parser<'a, I, O2, E, T2>, P3: Parser<'a, I, O3, E, T3>, P4: Parser<'a, I, O4, E, T4>, P5: Parser<'a, I, O5, E, T5>, P6: Parser<'a, I, O6, E, T6>, P7: Parser<'a, I, O7, E, T7>, P8: Parser<'a, I, O8, E, T8>, P9: Parser<'a, I, O9, E, T9>, P10: Parser<'a, I, O10, E, T10>, P11: Parser<'a, I, O11, E, T11>,

Implementors§

Source§

impl<'a, I, E: ParserError> Parser<'a, I, &'a I, E, Take> for Take
where I: ?Sized + Sequence,

Source§

impl<'a, I, F, E, Item> Parser<'a, I, Item, E, FnBoolRefSeqParser> for F
where I: ?Sized + Sequence<Item = Item>, F: Fn(&Item) -> bool, E: ParserError, Item: Clone,

Source§

impl<'a, I, F, E, Item> Parser<'a, I, Item, E, FnBoolSeqParser> for F
where I: ?Sized + Sequence<Item = Item>, F: Fn(Item) -> bool, E: ParserError, Item: Clone,

Source§

impl<'a, I, F, E, Item, FnOut> Parser<'a, I, FnOut, E, FnOptionRefSeqParser> for F
where I: ?Sized + Sequence<Item = Item>, F: Fn(&Item) -> Option<FnOut>, E: ParserError, Item: Clone,

Source§

impl<'a, I, F, E, Item, FnOut> Parser<'a, I, FnOut, E, FnOptionSeqParser> for F
where I: ?Sized + Sequence<Item = Item>, F: Fn(Item) -> Option<FnOut>, E: ParserError, Item: Clone,

Source§

impl<'a, I, F, E, Item, FnOut, FnErr> Parser<'a, I, FnOut, E, FnResultRefSeqParser> for F
where I: ?Sized + Sequence<Item = Item>, F: Fn(&Item) -> Result<FnOut, FnErr>, E: ParserError, Item: Clone, FnErr: 'static + Error + Send + Sync,

Source§

impl<'a, I, F, E, Item, FnOut, FnErr> Parser<'a, I, FnOut, E, FnResultSeqParser> for F
where I: ?Sized + Sequence<Item = Item>, F: Fn(Item) -> Result<FnOut, FnErr>, E: ParserError, Item: Clone, FnErr: 'static + Error + Send + Sync,

Source§

impl<'a, I, O, E: ParserError, ParType, P, Item> Parser<'a, I, Item, E, TakeNotParser<ParType, O>> for TakeNot<P>
where P: Parser<'a, I, O, E, ParType>, I: ?Sized + Sequence<Item = Item>,

Source§

impl<'a, I, O, E: ParserError, ParType, P, V> Parser<'a, I, V, E, ValueParser<ParType, O>> for Value<P, V, I, O, E>
where P: Parser<'a, I, O, E, ParType>, I: ?Sized + Sequence, V: Clone,

Source§

impl<'a, I: ?Sized + Sequence, O1, E: ParserError, P1, T1> Parser<'a, I, (O1,), E, SeqAlt1<T1>> for Permutation<(P1,)>
where P1: Parser<'a, I, O1, E, T1>,

Source§

impl<'a, I: ?Sized + Sequence, O1, O2, E: ParserError, P1, T1, P2, T2> Parser<'a, I, (O1, O2), E, SeqAlt2<T1, T2>> for Permutation<(P1, P2)>
where P1: Parser<'a, I, O1, E, T1>, P2: Parser<'a, I, O2, E, T2>,

Source§

impl<'a, I: ?Sized + Sequence, O1, O2, O3, E: ParserError, P1, T1, P2, T2, P3, T3> Parser<'a, I, (O1, O2, O3), E, SeqAlt3<T1, T2, T3>> for Permutation<(P1, P2, P3)>
where P1: Parser<'a, I, O1, E, T1>, P2: Parser<'a, I, O2, E, T2>, P3: Parser<'a, I, O3, E, T3>,

Source§

impl<'a, I: ?Sized + Sequence, O1, O2, O3, O4, E: ParserError, P1, T1, P2, T2, P3, T3, P4, T4> Parser<'a, I, (O1, O2, O3, O4), E, SeqAlt4<T1, T2, T3, T4>> for Permutation<(P1, P2, P3, P4)>
where P1: Parser<'a, I, O1, E, T1>, P2: Parser<'a, I, O2, E, T2>, P3: Parser<'a, I, O3, E, T3>, P4: Parser<'a, I, O4, E, T4>,

Source§

impl<'a, I: ?Sized + Sequence, O1, O2, O3, O4, O5, E: ParserError, P1, T1, P2, T2, P3, T3, P4, T4, P5, T5> Parser<'a, I, (O1, O2, O3, O4, O5), E, SeqAlt5<T1, T2, T3, T4, T5>> for Permutation<(P1, P2, P3, P4, P5)>
where P1: Parser<'a, I, O1, E, T1>, P2: Parser<'a, I, O2, E, T2>, P3: Parser<'a, I, O3, E, T3>, P4: Parser<'a, I, O4, E, T4>, P5: Parser<'a, I, O5, E, T5>,

Source§

impl<'a, I: ?Sized + Sequence, O1, O2, O3, O4, O5, O6, E: ParserError, P1, T1, P2, T2, P3, T3, P4, T4, P5, T5, P6, T6> Parser<'a, I, (O1, O2, O3, O4, O5, O6), E, SeqAlt6<T1, T2, T3, T4, T5, T6>> for Permutation<(P1, P2, P3, P4, P5, P6)>
where P1: Parser<'a, I, O1, E, T1>, P2: Parser<'a, I, O2, E, T2>, P3: Parser<'a, I, O3, E, T3>, P4: Parser<'a, I, O4, E, T4>, P5: Parser<'a, I, O5, E, T5>, P6: Parser<'a, I, O6, E, T6>,

Source§

impl<'a, I: ?Sized + Sequence, O1, O2, O3, O4, O5, O6, O7, E: ParserError, P1, T1, P2, T2, P3, T3, P4, T4, P5, T5, P6, T6, P7, T7> Parser<'a, I, (O1, O2, O3, O4, O5, O6, O7), E, SeqAlt7<T1, T2, T3, T4, T5, T6, T7>> for Permutation<(P1, P2, P3, P4, P5, P6, P7)>
where P1: Parser<'a, I, O1, E, T1>, P2: Parser<'a, I, O2, E, T2>, P3: Parser<'a, I, O3, E, T3>, P4: Parser<'a, I, O4, E, T4>, P5: Parser<'a, I, O5, E, T5>, P6: Parser<'a, I, O6, E, T6>, P7: Parser<'a, I, O7, E, T7>,

Source§

impl<'a, I: ?Sized + Sequence, O1, O2, O3, O4, O5, O6, O7, O8, E: ParserError, P1, T1, P2, T2, P3, T3, P4, T4, P5, T5, P6, T6, P7, T7, P8, T8> Parser<'a, I, (O1, O2, O3, O4, O5, O6, O7, O8), E, SeqAlt8<T1, T2, T3, T4, T5, T6, T7, T8>> for Permutation<(P1, P2, P3, P4, P5, P6, P7, P8)>
where P1: Parser<'a, I, O1, E, T1>, P2: Parser<'a, I, O2, E, T2>, P3: Parser<'a, I, O3, E, T3>, P4: Parser<'a, I, O4, E, T4>, P5: Parser<'a, I, O5, E, T5>, P6: Parser<'a, I, O6, E, T6>, P7: Parser<'a, I, O7, E, T7>, P8: Parser<'a, I, O8, E, T8>,

Source§

impl<'a, I: ?Sized + Sequence, O1, O2, O3, O4, O5, O6, O7, O8, O9, E: ParserError, P1, T1, P2, T2, P3, T3, P4, T4, P5, T5, P6, T6, P7, T7, P8, T8, P9, T9> Parser<'a, I, (O1, O2, O3, O4, O5, O6, O7, O8, O9), E, SeqAlt9<T1, T2, T3, T4, T5, T6, T7, T8, T9>> for Permutation<(P1, P2, P3, P4, P5, P6, P7, P8, P9)>
where P1: Parser<'a, I, O1, E, T1>, P2: Parser<'a, I, O2, E, T2>, P3: Parser<'a, I, O3, E, T3>, P4: Parser<'a, I, O4, E, T4>, P5: Parser<'a, I, O5, E, T5>, P6: Parser<'a, I, O6, E, T6>, P7: Parser<'a, I, O7, E, T7>, P8: Parser<'a, I, O8, E, T8>, P9: Parser<'a, I, O9, E, T9>,

Source§

impl<'a, I: ?Sized + Sequence, O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, E: ParserError, P1, T1, P2, T2, P3, T3, P4, T4, P5, T5, P6, T6, P7, T7, P8, T8, P9, T9, P10, T10> Parser<'a, I, (O1, O2, O3, O4, O5, O6, O7, O8, O9, O10), E, SeqAlt10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>> for Permutation<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10)>
where P1: Parser<'a, I, O1, E, T1>, P2: Parser<'a, I, O2, E, T2>, P3: Parser<'a, I, O3, E, T3>, P4: Parser<'a, I, O4, E, T4>, P5: Parser<'a, I, O5, E, T5>, P6: Parser<'a, I, O6, E, T6>, P7: Parser<'a, I, O7, E, T7>, P8: Parser<'a, I, O8, E, T8>, P9: Parser<'a, I, O9, E, T9>, P10: Parser<'a, I, O10, E, T10>,

Source§

impl<'a, I: ?Sized + Sequence, O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11, E: ParserError, P1, T1, P2, T2, P3, T3, P4, T4, P5, T5, P6, T6, P7, T7, P8, T8, P9, T9, P10, T10, P11, T11> Parser<'a, I, (O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11), E, SeqAlt11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>> for Permutation<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11)>
where P1: Parser<'a, I, O1, E, T1>, P2: Parser<'a, I, O2, E, T2>, P3: Parser<'a, I, O3, E, T3>, P4: Parser<'a, I, O4, E, T4>, P5: Parser<'a, I, O5, E, T5>, P6: Parser<'a, I, O6, E, T6>, P7: Parser<'a, I, O7, E, T7>, P8: Parser<'a, I, O8, E, T8>, P9: Parser<'a, I, O9, E, T9>, P10: Parser<'a, I, O10, E, T10>, P11: Parser<'a, I, O11, E, T11>,

Source§

impl<'a, I: ?Sized + Sequence, O, E: ParserError, P1, T1> Parser<'a, I, O, E, Alt1<T1>> for Alt<(P1,)>
where P1: Parser<'a, I, O, E, T1>,

Source§

impl<'a, I: ?Sized + Sequence, O, E: ParserError, P1, T1, P2, T2> Parser<'a, I, O, E, Alt2<T1, T2>> for Alt<(P1, P2)>
where P1: Parser<'a, I, O, E, T1>, P2: Parser<'a, I, O, E, T2>,

Source§

impl<'a, I: ?Sized + Sequence, O, E: ParserError, P1, T1, P2, T2, P3, T3> Parser<'a, I, O, E, Alt3<T1, T2, T3>> for Alt<(P1, P2, P3)>
where P1: Parser<'a, I, O, E, T1>, P2: Parser<'a, I, O, E, T2>, P3: Parser<'a, I, O, E, T3>,

Source§

impl<'a, I: ?Sized + Sequence, O, E: ParserError, P1, T1, P2, T2, P3, T3, P4, T4> Parser<'a, I, O, E, Alt4<T1, T2, T3, T4>> for Alt<(P1, P2, P3, P4)>
where P1: Parser<'a, I, O, E, T1>, P2: Parser<'a, I, O, E, T2>, P3: Parser<'a, I, O, E, T3>, P4: Parser<'a, I, O, E, T4>,

Source§

impl<'a, I: ?Sized + Sequence, O, E: ParserError, P1, T1, P2, T2, P3, T3, P4, T4, P5, T5> Parser<'a, I, O, E, Alt5<T1, T2, T3, T4, T5>> for Alt<(P1, P2, P3, P4, P5)>
where P1: Parser<'a, I, O, E, T1>, P2: Parser<'a, I, O, E, T2>, P3: Parser<'a, I, O, E, T3>, P4: Parser<'a, I, O, E, T4>, P5: Parser<'a, I, O, E, T5>,

Source§

impl<'a, I: ?Sized + Sequence, O, E: ParserError, P1, T1, P2, T2, P3, T3, P4, T4, P5, T5, P6, T6> Parser<'a, I, O, E, Alt6<T1, T2, T3, T4, T5, T6>> for Alt<(P1, P2, P3, P4, P5, P6)>
where P1: Parser<'a, I, O, E, T1>, P2: Parser<'a, I, O, E, T2>, P3: Parser<'a, I, O, E, T3>, P4: Parser<'a, I, O, E, T4>, P5: Parser<'a, I, O, E, T5>, P6: Parser<'a, I, O, E, T6>,

Source§

impl<'a, I: ?Sized + Sequence, O, E: ParserError, P1, T1, P2, T2, P3, T3, P4, T4, P5, T5, P6, T6, P7, T7> Parser<'a, I, O, E, Alt7<T1, T2, T3, T4, T5, T6, T7>> for Alt<(P1, P2, P3, P4, P5, P6, P7)>
where P1: Parser<'a, I, O, E, T1>, P2: Parser<'a, I, O, E, T2>, P3: Parser<'a, I, O, E, T3>, P4: Parser<'a, I, O, E, T4>, P5: Parser<'a, I, O, E, T5>, P6: Parser<'a, I, O, E, T6>, P7: Parser<'a, I, O, E, T7>,

Source§

impl<'a, I: ?Sized + Sequence, O, E: ParserError, P1, T1, P2, T2, P3, T3, P4, T4, P5, T5, P6, T6, P7, T7, P8, T8> Parser<'a, I, O, E, Alt8<T1, T2, T3, T4, T5, T6, T7, T8>> for Alt<(P1, P2, P3, P4, P5, P6, P7, P8)>
where P1: Parser<'a, I, O, E, T1>, P2: Parser<'a, I, O, E, T2>, P3: Parser<'a, I, O, E, T3>, P4: Parser<'a, I, O, E, T4>, P5: Parser<'a, I, O, E, T5>, P6: Parser<'a, I, O, E, T6>, P7: Parser<'a, I, O, E, T7>, P8: Parser<'a, I, O, E, T8>,

Source§

impl<'a, I: ?Sized + Sequence, O, E: ParserError, P1, T1, P2, T2, P3, T3, P4, T4, P5, T5, P6, T6, P7, T7, P8, T8, P9, T9> Parser<'a, I, O, E, Alt9<T1, T2, T3, T4, T5, T6, T7, T8, T9>> for Alt<(P1, P2, P3, P4, P5, P6, P7, P8, P9)>
where P1: Parser<'a, I, O, E, T1>, P2: Parser<'a, I, O, E, T2>, P3: Parser<'a, I, O, E, T3>, P4: Parser<'a, I, O, E, T4>, P5: Parser<'a, I, O, E, T5>, P6: Parser<'a, I, O, E, T6>, P7: Parser<'a, I, O, E, T7>, P8: Parser<'a, I, O, E, T8>, P9: Parser<'a, I, O, E, T9>,

Source§

impl<'a, I: ?Sized + Sequence, O, E: ParserError, P1, T1, P2, T2, P3, T3, P4, T4, P5, T5, P6, T6, P7, T7, P8, T8, P9, T9, P10, T10> Parser<'a, I, O, E, Alt10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>> for Alt<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10)>
where P1: Parser<'a, I, O, E, T1>, P2: Parser<'a, I, O, E, T2>, P3: Parser<'a, I, O, E, T3>, P4: Parser<'a, I, O, E, T4>, P5: Parser<'a, I, O, E, T5>, P6: Parser<'a, I, O, E, T6>, P7: Parser<'a, I, O, E, T7>, P8: Parser<'a, I, O, E, T8>, P9: Parser<'a, I, O, E, T9>, P10: Parser<'a, I, O, E, T10>,

Source§

impl<'a, I: ?Sized + Sequence, O, E: ParserError, P1, T1, P2, T2, P3, T3, P4, T4, P5, T5, P6, T6, P7, T7, P8, T8, P9, T9, P10, T10, P11, T11> Parser<'a, I, O, E, Alt11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>> for Alt<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11)>
where P1: Parser<'a, I, O, E, T1>, P2: Parser<'a, I, O, E, T2>, P3: Parser<'a, I, O, E, T3>, P4: Parser<'a, I, O, E, T4>, P5: Parser<'a, I, O, E, T5>, P6: Parser<'a, I, O, E, T6>, P7: Parser<'a, I, O, E, T7>, P8: Parser<'a, I, O, E, T8>, P9: Parser<'a, I, O, E, T9>, P10: Parser<'a, I, O, E, T10>, P11: Parser<'a, I, O, E, T11>,

Source§

impl<'a, I: ?Sized, O, E: ParserError, ParserType, P> Parser<'a, I, Option<O>, E, Opt<ParserType>> for Opt<P>
where P: Parser<'a, I, O, E, ParserType>,

Source§

impl<'a, Item, I, E, R> Parser<'a, I, Item, E, RangeSeqParser> for R
where I: ?Sized + Sequence<Item = Item>, E: ParserError, R: RangeBounds<Item>, Item: PartialOrd,

Source§

impl<'a, Item: PartialEq, I, E> Parser<'a, I, Item, E, ItemSeqParser> for Item
where I: ?Sized + Sequence<Item = Item>, E: ParserError,

Source§

impl<'a, P, I, O, E, PType, F, Acc, FErr, ReducerOut, AccOut> Parser<'a, I, AccOut, E, RepeatParser<PType, ReducerOut, FErr>> for Repeat<P, I, O, E, F, Acc>
where E: ParserError, I: ?Sized + Sequence, P: Parser<'a, I, O, E, PType>, Acc: Clone, FErr: 'static + Send + Sync + Error, F: TryReducer<'a, Acc, O, ReducerOut, FErr, AccOut, I>,

This function is generics soup, but the goal is this: It repeats applying the parser until it fails or exceeds the maximum bound. It accumulates the output of the parser into Acc using F. If F returns an error the parser also fails with that error. In iterator language, this is a TryReduce operator.

Source§

impl<'a, P, M, I, O, E: ParserError, PType, F> Parser<'a, I, O, E, ParserMapT<PType, M>> for ParserMap<P, I, M, E, F>
where P: Parser<'a, I, M, E, PType>, F: Fn(M) -> O, I: ?Sized + Sequence,

Source§

impl<'a, P, M, I, O, E: ParserError, PType, FErr, F> Parser<'a, I, O, E, ParserTryMapResult<PType, M, FErr>> for ParserTryMap<P, I, M, E, F>
where P: Parser<'a, I, M, E, PType>, FErr: Error + Send + Sync + 'static, F: Fn(M) -> Result<O, FErr>, I: ?Sized + Sequence,

Source§

impl<'a, P, M, I: ?Sized + Sequence, O, E: ParserError, PType, F> Parser<'a, I, O, E, ParserTryMapOption<PType, M>> for ParserTryMap<P, I, M, E, F>
where P: Parser<'a, I, M, E, PType>, F: Fn(M) -> Option<O>,

Source§

impl<'c, I: ?Sized + Sequence, O, E: ParserError, F> Parser<'c, I, O, E, ParserFunction> for F
where F: Fn(&mut &'c I) -> Result<O, E>,