[][src]Trait outline::parser::Parser

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> { ... } }

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

Associated Types

type Error: Error

The type of error for this parser

Loading content...

Required methods

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

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

Loading content...

Provided methods

fn parse_name<'a>(
    &self,
    input: &'a str
) -> Result<(String, Vec<&'a str>), ParseError>

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

fn parse_line<'a>(
    &self,
    line_number: usize,
    input: &'a str
) -> Result<Line<'a>, ParseError>

Parses a line as code, returning the parsed Line object

Loading content...

Implementors

impl Parser for BirdParser[src]

type Error = BirdError

impl Parser for HtmlParser[src]

type Error = HtmlError

impl Parser for MdParser[src]

type Error = MdError

impl Parser for TexParser[src]

type Error = TexError

Loading content...