pub trait FormatVariables {
// Required method
fn format_value(&self, variable: FormatVariable) -> Option<String>;
// Provided methods
fn format_value_by_name(&self, name: &str) -> Option<String> { ... }
fn format_name_exists(
&self,
_scope: Option<char>,
_name: &str,
) -> Option<bool> { ... }
fn format_loop(
&self,
_scope: char,
_body: &str,
_count_only: bool,
) -> Option<String> { ... }
}Expand description
A source of values for supported format variables.
Required Methods§
Sourcefn format_value(&self, variable: FormatVariable) -> Option<String>
fn format_value(&self, variable: FormatVariable) -> Option<String>
Resolves a supported format variable to its rendered value.
Provided Methods§
Sourcefn format_value_by_name(&self, name: &str) -> Option<String>
fn format_value_by_name(&self, name: &str) -> Option<String>
Resolves an arbitrary string-keyed variable name.
The default implementation delegates to the enum-based lookup. Runtime
implementors can override this to support @user options and the full
dynamic variable inventory.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".