Skip to main content

SimplePreprocessor

Trait SimplePreprocessor 

Source
pub trait SimplePreprocessor:
    Sized
    + Send
    + Sync {
    type Args: CommandFactory;

    // Required methods
    fn name() -> &'static str;
    fn build(ctx: &PreprocessorContext) -> Result<Self>;
    fn replacements(
        &self,
        chapter_dir: &Path,
        content: &str,
    ) -> Result<Vec<(Range<usize>, String)>>;
    fn linked_assets(&self) -> Vec<Asset>;
    fn all_assets(&self) -> Vec<Asset>;

    // Provided method
    fn finish(self) { ... }
}

Required Associated Types§

Required Methods§

Source

fn name() -> &'static str

Source

fn build(ctx: &PreprocessorContext) -> Result<Self>

Source

fn replacements( &self, chapter_dir: &Path, content: &str, ) -> Result<Vec<(Range<usize>, String)>>

Source

fn linked_assets(&self) -> Vec<Asset>

Source

fn all_assets(&self) -> Vec<Asset>

Provided Methods§

Source

fn finish(self)

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§