Skip to main content

Value

Trait Value 

Source
pub trait Value<T> {
    // Required method
    fn parse_value(text: Cow<'_, str>) -> Result<T>;
}
Expand description

Trait to parse attributes and inner text

This is implemented my “marker” types to decide how to parse a type (the same type can be parsed differently depending on the marker type)

Required Methods§

Source

fn parse_value(text: Cow<'_, str>) -> Result<T>

Serialize value to text

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Value<String> for ValueString

Source§

impl<'a> Value<Cow<'a, str>> for ValueString

Source§

impl<T> Value<T> for ValueDefault
where T: FromStr, T::Err: Error + 'static,