pub trait ExpandVars {
// Required method
fn expand_vars(&mut self) -> Result<(), ExpandVarsError>;
}Expand description
Trait for types whose String fields can be expanded from environment variables.
Typically derived via #[derive(ExpandVars)] from modkit-macros.
Fields marked with #[expand_vars] will have ${VAR} placeholders
replaced with the corresponding environment variable values.
§Errors
Returns ExpandVarsError if a referenced environment variable is missing
or contains invalid Unicode.
Required Methods§
Sourcefn expand_vars(&mut self) -> Result<(), ExpandVarsError>
fn expand_vars(&mut self) -> Result<(), ExpandVarsError>
Expand ${VAR} placeholders in marked fields from environment variables.
§Errors
Returns ExpandVarsError if a referenced environment variable is missing
or contains invalid Unicode.