[][src]Trait druid::env::ValueType

pub trait ValueType<'a>: Sized {
    type Owned: Into<Value>;
    fn try_from_value(v: &'a Value) -> Result<Self, EnvError>;
}

Values which can be stored in an environment.

Note that for "expensive" types this is the reference. For example, for strings, this trait is implemented on &'a str. The trait is parametrized on a lifetime so that it can be used for references in this way.

Associated Types

type Owned: Into<Value>

The corresponding owned type.

Loading content...

Required methods

fn try_from_value(v: &'a Value) -> Result<Self, EnvError>

Attempt to convert the generic Value into this type.

Loading content...

Implementors

Loading content...