Trait Parser

Source
pub trait Parser<T, E = ()> {
    // Required method
    fn parse<'s>(
        &self,
        source: &'s str,
        location: Span,
    ) -> ParseResult<'s, T, E>;
}
Expand description

A parser takes an input source and produces an array of potential tagged values and an array of errors.

Required Methods§

Source

fn parse<'s>(&self, source: &'s str, location: Span) -> ParseResult<'s, T, E>

Implementations on Foreign Types§

Source§

impl<E> Parser<char, E> for &char

Source§

fn parse<'s>(&self, source: &'s str, location: Span) -> ParseResult<'s, char, E>

Source§

impl<E> Parser<char, E> for char

Source§

fn parse<'s>(&self, source: &'s str, location: Span) -> ParseResult<'s, char, E>

Source§

impl<E> Parser<Span, E> for &str

Source§

fn parse<'s>(&self, source: &'s str, location: Span) -> ParseResult<'s, Span, E>

Source§

impl<E> Parser<Span, E> for str

Source§

fn parse<'s>(&self, source: &'s str, location: Span) -> ParseResult<'s, Span, E>

Source§

impl<E> Parser<Span, E> for String

Source§

fn parse<'s>(&self, source: &'s str, location: Span) -> ParseResult<'s, Span, E>

Implementors§

Source§

impl<'p, T, E> Parser<T, E> for Boxed<dyn Parser<T, E> + 'p>

Source§

impl<'p, T, E, P: Parser<T, E>> Parser<T, E> for Referenced<'p, P, E>

Source§

impl<A, B, PA, PB, E> Parser<(A, B), E> for Pair<PA, PB, E>
where A: Clone, PA: Parser<A, E>, PB: Parser<B, E>,

Source§

impl<A, B, T, E> Parser<T, E> for And<A, B, E>
where T: Concat + Clone, A: Parser<T, E>, B: Parser<T, E>,

Source§

impl<A, B, T: Clone, E> Parser<T, E> for OnFailure<A, B, E>
where A: Parser<T, E>, B: Parser<T, E>,

Source§

impl<A, B, T: Clone, E> Parser<T, E> for OnNone<A, B, E>
where A: Parser<T, E>, B: Parser<T, E>,

Source§

impl<A, B, T: Clone, E> Parser<T, E> for Or<A, B, E>
where A: Parser<T, E>, B: Parser<T, E>,

Source§

impl<A, B, T: Clone, V, E> Parser<T, E> for Drop<A, B, V, E>
where A: Parser<T, E>, B: Parser<V, E>,

Source§

impl<A, B, T: Clone, V, E> Parser<T, E> for MaybeDrop<A, B, V, E>
where A: Parser<T, E>, B: Parser<V, E>,

Source§

impl<E, P: Parser<Span, E>> Parser<String, E> for StringMap<P, E>

Source§

impl<E, P: Parser<Span, E>, F: Fn(&str) -> bool> Parser<Span, E> for StrCondition<P, F, E>

Source§

impl<P, F, T, E, Q> Parser<T, E> for Fold<P, F, E>
where T: Clone, P: Parser<T, E>, Q: Parser<T, E>, F: Fn(T) -> Q + Clone,

Source§

impl<P, F, T, E, Q, V> Parser<V, E> for AndThen<P, F, T, E>
where P: Parser<T, E>, Q: Parser<V, E>, F: Fn(T) -> Q,

Source§

impl<P, F, T, E, V> Parser<V, E> for Map<P, F, T, E>
where P: Parser<T, E>, F: Fn(T) -> V,

Source§

impl<P, Q, T, V, E> Parser<V, E> for Skip<P, Q, T, E>
where P: Parser<T, E>, Q: Parser<V, E>,

Source§

impl<T, D, E, R, P, S> Parser<List<T>, E> for DelimitedBy<P, S, D, R, E>
where T: Clone, R: RangeBounds<usize> + Clone, P: Parser<T, E>, S: Parser<D, E>,

Source§

impl<T, D, E, R, P, S> Parser<List<T>, E> for StrictlyDelimitedBy<P, S, D, R, E>
where T: Clone, R: RangeBounds<usize> + Clone, P: Parser<T, E>, S: Parser<D, E>,

Source§

impl<T, E, F> Parser<T, E> for F
where F: for<'s> Fn(&'s str, Span) -> ParseResult<'s, T, E>,

Source§

impl<T, E, P: Parser<T, E>> Parser<List<T>, E> for ListMap<P, E>

Source§

impl<T, E, P: Parser<T, E>> Parser<Meta<T, Span>, E> for MetaMap<P, E>

Source§

impl<T, E, P: Parser<T, E>> Parser<T, E> for Catch<P, E>

Source§

impl<T, E, P: Parser<T, E>> Parser<T, E> for End<P, E>

Source§

impl<T, E, P: Parser<T, E>> Parser<T, E> for SpaceBefore<P, E>

Source§

impl<T, E, P: Parser<T, E>, F: Fn(&T) -> bool> Parser<T, E> for Condition<P, F, E>

Source§

impl<T, I: FromIterator<T>, E, P: Parser<List<T>, E>> Parser<I, E> for Collect<P, T, I, E>

Source§

impl<T, O, C, P, OP, CP, E> Parser<T, E> for SurroundedBy<P, OP, CP, O, C, E>
where T: Clone, P: Parser<T, E>, OP: Parser<C, E>, CP: Parser<C, E>,

Source§

impl<T: Clone, E, P: Parser<T, E>> Parser<T, E> for MaybeSpaceAfter<P, E>

Source§

impl<T: Clone, E, P: Parser<T, E>> Parser<T, E> for MaybeSpaceAround<P, E>

Source§

impl<T: Clone, E, P: Parser<T, E>> Parser<T, E> for MaybeSpaceBefore<P, E>

Source§

impl<T: Clone, E, P: Parser<T, E>> Parser<T, E> for SpaceAfter<P, E>

Source§

impl<T: Clone, E, P: Parser<T, E>> Parser<T, E> for SpaceAround<P, E>

Source§

impl<T: PartialEq<V>, V, E, P: Parser<T, E>> Parser<T, E> for Matching<P, V, E>

Source§

impl<T: Concat + Clone, E, P: Parser<T, E>> Parser<T, E> for Multiple<P, E>

Source§

impl<T: Concat + Clone, E, R: RangeBounds<usize>, P: Parser<T, E>> Parser<T, E> for Repeat<P, R, E>

Source§

impl<T: Concat, E, P: Parser<T, E>> Parser<T, E> for Maybe<P, E>