Trait outline::parser::Parser

source ·
pub trait Parser: ParserConfig {
    type Error: Error;

    fn parse<'a>(&self, input: &'a str) -> Result<Document<'a>, Self::Error>;

    fn parse_name<'a>(
        &self,
        input: &'a str
    ) -> Result<(String, Vec<&'a str>), ParseError> { ... } fn parse_line<'a>(
        &self,
        line_number: usize,
        input: &'a str
    ) -> Result<Line<'a>, ParseError> { ... } }
Expand description

A Parser determines which lines are code and which are text, and may use its Config to actually handle reading the lines of code

Required Associated Types

The type of error for this parser

Required Methods

Parses the text part of the document. Should delegate the code section on a line-by-line basis to the built in code parser.

Provided Methods

Parses a macro name, returning the name and the extracted variables

Parses a line as code, returning the parsed Line object

Implementors