Skip to main content

IncludeSourceProvider

Trait IncludeSourceProvider 

Source
pub trait IncludeSourceProvider {
    // Required method
    fn open(
        &self,
        target: &IncludeSourceTarget,
    ) -> Result<IncludeSource, IncludeSourceError>;
}
Expand description

Supplies bytes for include targets resolved by the parser.

Implement this trait to parse against an editor overlay, virtual filesystem, embedded source map, restricted filesystem capability, or custom HTTP client. The parser checks safe mode and URI permission before calling the provider.

Required Methods§

Source

fn open( &self, target: &IncludeSourceTarget, ) -> Result<IncludeSource, IncludeSourceError>

Open one resolved include target.

§Errors

Return a classified IncludeSourceError when the target cannot be supplied. The parser maps recoverable failures to Asciidoctor-compatible include diagnostics and fallbacks.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§