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_search(&self, _options: &str, _pattern: &str) -> Option<String> { ... }
fn format_loop(
&self,
_scope: char,
_body: &str,
_current_body: Option<&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.
Sourcefn format_name_exists(&self, _scope: Option<char>, _name: &str) -> Option<bool>
fn format_name_exists(&self, _scope: Option<char>, _name: &str) -> Option<bool>
Checks whether a window or session name exists for the N: modifier.
scope is None or Some('w') for windows and Some('s') for
sessions.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".