Skip to main content

Resolver

Trait Resolver 

Source
pub trait Resolver: Send + Sync {
    // Required method
    fn resolve(
        &self,
        reference: Option<&str>,
        input: &ResolverInput<'_>,
    ) -> Resolution;
}
Expand description

Find the source content a reference names.

Implementations must be Send + Sync: a Tabnas instance parses through &self, so the plugin, its options and every callback they hold are shared across threads. Nothing is held in global state, so two parsers configured differently never see each other’s sources.

Required Methods§

Source

fn resolve( &self, reference: Option<&str>, input: &ResolverInput<'_>, ) -> Resolution

Resolve reference to a Resolution. A reference that names nothing returns Resolution::not_found; raising the error is the plugin’s job, not the resolver’s.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§