Parser

Trait Parser 

Source
pub trait Parser {
    type Input;
    type Output;

    // Required method
    fn parse(&self, data: &[Self::Input]) -> ParseResult<Self::Output>;
}
Expand description

Generic parser trait. Only Output and parse need to be defined to apply the trait.

Required Associated Types§

Required Methods§

Source

fn parse(&self, data: &[Self::Input]) -> ParseResult<Self::Output>

Parse data, and return a ParseResult.

Implementors§

Source§

impl<'f, I, O> Parser for CustomParser<'f, I, O>

Source§

type Input = I

Source§

type Output = O

Source§

impl<'l, 'r, I, L, R> Parser for AndParser<'l, 'r, I, L, R>

Source§

impl<'l, 'r, I, L, R> Parser for OrParser<'l, 'r, I, L, R>

Source§

impl<'p, I, O> Parser for IgnoreParser<'p, I, O>

Source§

impl<'p, I, O> Parser for RangeParser<'p, I, O>

Source§

type Input = I

Source§

type Output = Vec<O>

Source§

impl<I> Parser for FailParser<I>

Source§

impl<I: PartialEq + Clone> Parser for LiteralParser<I>

Source§

type Input = I

Source§

type Output = I