Skip to main content

FromValue

Trait FromValue 

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

A type a value converts into, failing with an Error when it holds something else: every TryFrom<Value> whose error is one, Value itself included.

Supporting trait: it is only there to make this crate’s API easier to use, it is implemented for everything that API accepts and is not one to implement anywhere else.

Required Methods§

Source

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

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<T> FromValue for T
where T: TryFrom<Value>, T::Error: Into<Error>,