FromValue

Trait FromValue 

Source
pub trait FromValue<OK = Self> {
    // Required method
    fn from_value(value: Value) -> Result<OK, ConversionError>;

    // Provided method
    fn from_no_value() -> Result<OK, ConversionError> { ... }
}
Expand description

Trait for conversion from Value into arbitrary types.

This trait is used by the get and lookup Value methods.

Implementations exist for several standard types.

Implemnataions can be automatically derived by using the nereon_derive crate.

Required Methods§

Provided Methods§

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.

Implementations on Foreign Types§

Source§

impl FromValue for f32

Source§

impl FromValue for f64

Source§

impl FromValue for i8

Source§

impl FromValue for i16

Source§

impl FromValue for i32

Source§

impl FromValue for i64

Source§

impl FromValue for u8

Source§

impl FromValue for u16

Source§

impl FromValue for u32

Source§

impl FromValue for u64

Source§

impl FromValue for String

Source§

impl<T> FromValue for Option<T>
where T: FromValue,

Source§

impl<T> FromValue for Vec<T>
where T: FromValue,

Source§

impl<T, S: BuildHasher + Default> FromValue for HashMap<String, T, S>
where T: FromValue,

Implementors§