Skip to main content

Compiler

Trait Compiler 

Source
pub trait Compiler: Send + Sync {
    // Required methods
    fn input(&self) -> TreeKind;
    fn extension(&self) -> &'static str;
    fn compile(&self, tree: &Tree<'_>, file: &mut File) -> Result<String, Error>;

    // Provided method
    fn html_target(&self) -> Option<HtmlTarget> { ... }
}
Expand description

Turns a tree into output text, whose kind extension names (html, md).

Required Methods§

Source

fn input(&self) -> TreeKind

Source

fn extension(&self) -> &'static str

Source

fn compile(&self, tree: &Tree<'_>, file: &mut File) -> Result<String, Error>

Provided Methods§

Source

fn html_target(&self) -> Option<HtmlTarget>

What a stage before this compiler must match to write its HTML in its place.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§