Skip to main content

SyncResolver

Trait SyncResolver 

Source
pub trait SyncResolver {
    // Required method
    fn resolve_variable(&self, key: &str) -> Result<String>;

    // Provided method
    fn resolve_template(&self, template: &Template) -> Result<String> { ... }
}
Expand description

Resolves a template to a string.

Because this trait is synchronous, implementations should not perform I/O. Mostly this is an abstraction over PreparedResolver to allow tests to inject fakes.

Required Methods§

Source

fn resolve_variable(&self, key: &str) -> Result<String>

Resolves a variable to a string.

This must be implemented, but consumers should not usually call it directly: call resolve_template instead.

Provided Methods§

Source

fn resolve_template(&self, template: &Template) -> Result<String>

Resolves the given template.

Do not override this implementation.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§