pub trait Value:
Any
+ AsAny
+ Debug
+ Send
+ Sync {
// Required methods
fn type_name() -> Cow<'static, str>
where Self: Sized;
fn parse(input: VarInput<'_>) -> Result<Self, VarParseError>
where Self: Sized;
fn format(&self) -> String;
fn box_clone(&self) -> Box<dyn Value>;
// Provided method
fn parse_dyn_value(
input: VarInput<'_>,
) -> Result<Box<dyn Value>, VarParseError>
where Self: Sized { ... }
}
Expand description
Defines a value that get stored as part of a System or Session variable.
This trait is partially object safe, see VarDefinition
for more details.
Required Methods§
fn type_name() -> Cow<'static, str>where
Self: Sized,
fn parse(input: VarInput<'_>) -> Result<Self, VarParseError>where
Self: Sized,
fn format(&self) -> String
fn box_clone(&self) -> Box<dyn Value>
Provided Methods§
sourcefn parse_dyn_value(input: VarInput<'_>) -> Result<Box<dyn Value>, VarParseError>where
Self: Sized,
fn parse_dyn_value(input: VarInput<'_>) -> Result<Box<dyn Value>, VarParseError>where
Self: Sized,
Parse an instance of Self
from VarInput
, returning it as a Box<dyn Value>
.