Skip to main content

FromValue

Trait FromValue 

Source
pub trait FromValue: Sized {
    // Required method
    fn from_value(value: &Value) -> Result<Self>;
}
Expand description

Trait for fallible conversion from Value.

Required Methods§

Source

fn from_value(value: &Value) -> Result<Self>

Converts a Value reference to Self.

§Errors

Returns UniError::Type if the value cannot be converted.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T> FromValue for T
where T: for<'a> TryFrom<&'a Value, Error = UniError>,

Blanket implementation: any T: TryFrom<&Value, Error = UniError> is FromValue.