[][src]Trait druid::ValueType

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

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, ValueTypeError>

Attempt to convert the generic Value into this type.

Loading content...

Implementations on Foreign Types

impl<'a> ValueType<'a> for f64[src]

type Owned = f64

impl<'a> ValueType<'a> for bool[src]

type Owned = bool

impl<'a> ValueType<'a> for u64[src]

type Owned = u64

impl<'a> ValueType<'a> for &'a str[src]

type Owned = String

Loading content...

Implementors

impl<'a> ValueType<'a> for Color[src]

type Owned = Color

impl<'a> ValueType<'a> for Point[src]

type Owned = Point

impl<'a> ValueType<'a> for Rect[src]

type Owned = Rect

impl<'a> ValueType<'a> for Size[src]

type Owned = Size

Loading content...