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§
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 Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.