Entity

Trait Entity 

Source
pub trait Entity {
    // Provided methods
    fn parse(&mut self, source: &Path) -> Result<()> { ... }
    fn render(
        &self,
        env: &Environment<'_>,
        context: Context,
        dest: &Path,
    ) -> Result<()> { ... }
}
Expand description

A trait represents the entity of config file.

An entity contains two stage:

  • parse, the stage the entity to parse its attribute, such as parse markdown to html.
  • render, the stage to render the entity to html file.

Entity has default empty implementations for both methods.

Provided Methods§

Source

fn parse(&mut self, source: &Path) -> Result<()>

Source

fn render( &self, env: &Environment<'_>, context: Context, dest: &Path, ) -> Result<()>

Implementations on Foreign Types§

Source§

impl<T: Entity + Sync + Send + Clone + 'static> Entity for Vec<T>

Source§

fn parse(&mut self, source: &Path) -> Result<()>

Source§

fn render( &self, env: &Environment<'_>, context: Context, dest: &Path, ) -> Result<()>

Source§

impl<T: Entity> Entity for Option<T>

Source§

fn parse(&mut self, source: &Path) -> Result<()>

Source§

fn render( &self, env: &Environment<'_>, context: Context, dest: &Path, ) -> Result<()>

Implementors§