Skip to main content

Parser

Trait Parser 

Source
pub trait Parser {
    // Required methods
    fn matches(&self, path: &str) -> bool;
    fn parse(&self, path: &str, content: &str) -> ParseResult;
}
Expand description

Trait implemented by the built-in text parsers.

Required Methods§

Source

fn matches(&self, path: &str) -> bool

Check whether this parser should run on a given file path.

Source

fn parse(&self, path: &str, content: &str) -> ParseResult

Parse a file’s content and return discovered links + optional metadata.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§