pub trait Var: Debug {
// Required methods
fn name(&self) -> &'static str;
fn value(&self) -> String;
fn description(&self) -> &'static str;
fn type_name(&self) -> Cow<'static, str>;
fn visible(
&self,
user: &User,
system_vars: Option<&SystemVars>,
) -> Result<(), VarError>;
// Provided method
fn as_var(&self) -> &dyn Var
where Self: Sized { ... }
}
Expand description
A Var
represents a configuration parameter of an arbitrary type.
Required Methods§
sourcefn value(&self) -> String
fn value(&self) -> String
Constructs a flattened string representation of the current value of the configuration parameter.
The resulting string is guaranteed to be parsable if provided to
Value::parse
as a VarInput::Flat
.
sourcefn description(&self) -> &'static str
fn description(&self) -> &'static str
Returns a short sentence describing the purpose of the configuration parameter.