Skip to main content

Renderer

Trait Renderer 

Source
pub trait Renderer {
    // Required methods
    fn render_header(&self, content: &str, level: usize) -> String;
    fn render_front_matter(&self, title: Option<&str>) -> String;
    fn render_reference(
        &self,
        display_text: Option<String>,
        target_prefix: &Path,
        target: String,
    ) -> Result<String>;
    fn content_path(&self) -> Option<PathBuf>;
    fn index_file(&self, title: Option<String>) -> Option<(PathBuf, String)>;
}

Required Methods§

Source

fn render_header(&self, content: &str, level: usize) -> String

Source

fn render_front_matter(&self, title: Option<&str>) -> String

Source

fn render_reference( &self, display_text: Option<String>, target_prefix: &Path, target: String, ) -> Result<String>

Source

fn content_path(&self) -> Option<PathBuf>

Source

fn index_file(&self, title: Option<String>) -> Option<(PathBuf, String)>

Trait Implementations§

Source§

impl Renderer for Box<dyn Renderer>

Source§

fn render_header(&self, content: &str, level: usize) -> String

Source§

fn render_front_matter(&self, title: Option<&str>) -> String

Source§

fn render_reference( &self, display_text: Option<String>, target_prefix: &Path, target: String, ) -> Result<String>

Source§

fn content_path(&self) -> Option<PathBuf>

Source§

fn index_file(&self, title: Option<String>) -> Option<(PathBuf, String)>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Renderer for Box<dyn Renderer>

Source§

fn render_header(&self, content: &str, level: usize) -> String

Source§

fn render_front_matter(&self, title: Option<&str>) -> String

Source§

fn render_reference( &self, display_text: Option<String>, target_prefix: &Path, target: String, ) -> Result<String>

Source§

fn content_path(&self) -> Option<PathBuf>

Source§

fn index_file(&self, title: Option<String>) -> Option<(PathBuf, String)>

Source§

impl<T: Renderer + ?Sized> Renderer for &T

Source§

fn render_header(&self, content: &str, level: usize) -> String

Source§

fn render_reference( &self, display_text: Option<String>, target_prefix: &Path, target: String, ) -> Result<String>

Source§

fn render_front_matter(&self, title: Option<&str>) -> String

Source§

fn content_path(&self) -> Option<PathBuf>

Source§

fn index_file(&self, title: Option<String>) -> Option<(PathBuf, String)>

Implementors§