[][src]Trait melib::parsec::Parser

pub trait Parser<'a, Output> {
    fn parse(&self, input: &'a str) -> Result<'a, Output>;

    fn parse_complete(&self, input: &'a str) -> Result<'a, Output> { ... }
fn map<F, NewOutput>(self, map_fn: F) -> BoxedParser<'a, NewOutput>
    where
        Self: Sized + 'a,
        Output: 'a,
        NewOutput: 'a,
        F: Fn(Output) -> NewOutput + 'a
, { ... }
fn and_then<F, NextParser, NewOutput>(
        self,
        f: F
    ) -> BoxedParser<'a, NewOutput>
    where
        Self: Sized + 'a,
        Output: 'a,
        NewOutput: 'a,
        NextParser: Parser<'a, NewOutput> + 'a,
        F: Fn(Output) -> NextParser + 'a
, { ... } }

Required methods

fn parse(&self, input: &'a str) -> Result<'a, Output>

Loading content...

Provided methods

fn parse_complete(&self, input: &'a str) -> Result<'a, Output>

fn map<F, NewOutput>(self, map_fn: F) -> BoxedParser<'a, NewOutput> where
    Self: Sized + 'a,
    Output: 'a,
    NewOutput: 'a,
    F: Fn(Output) -> NewOutput + 'a, 

fn and_then<F, NextParser, NewOutput>(self, f: F) -> BoxedParser<'a, NewOutput> where
    Self: Sized + 'a,
    Output: 'a,
    NewOutput: 'a,
    NextParser: Parser<'a, NewOutput> + 'a,
    F: Fn(Output) -> NextParser + 'a, 

Loading content...

Implementors

impl<'a, F, Output> Parser<'a, Output> for F where
    F: Fn(&'a str) -> Result<'_, Output>, 
[src]

impl<'a, Output> Parser<'a, Output> for BoxedParser<'a, Output>[src]

Loading content...