Trait style::values::computed::ToComputedValue [] [src]

pub trait ToComputedValue {
    type ComputedValue;
    fn to_computed_value(&self, context: &Context) -> Self::ComputedValue;
fn from_computed_value(computed: &Self::ComputedValue) -> Self; }

A trait to represent the conversion between computed and specified values.

This trait is derivable with #[derive(ToComputedValue)]. The derived implementation just calls ToComputedValue::to_computed_value on each field of the passed value, or Clone::clone if the field is annotated with #[compute(clone)].

Associated Types

The computed value type we're going to be converted to.

Required Methods

Convert a specified value to a computed value, using itself and the data inside the Context.

Convert a computed value to specified value form.

This will be used for recascading during animation. Such from_computed_valued values should recompute to the same value.

Implementations on Foreign Types

impl<A, B> ToComputedValue for (A, B) where
    A: ToComputedValue,
    B: ToComputedValue
[src]

impl<T> ToComputedValue for Option<T> where
    T: ToComputedValue
[src]

[src]

[src]

impl<T> ToComputedValue for Size2D<T> where
    T: ToComputedValue
[src]

[src]

[src]

impl<T> ToComputedValue for Vec<T> where
    T: ToComputedValue
[src]

[src]

[src]

impl<T> ToComputedValue for Box<T> where
    T: ToComputedValue
[src]

[src]

[src]

impl<T> ToComputedValue for Box<[T]> where
    T: ToComputedValue
[src]

[src]

[src]

impl ToComputedValue for ()
[src]

[src]

[src]

impl ToComputedValue for bool
[src]

[src]

[src]

impl ToComputedValue for f32
[src]

[src]

[src]

impl ToComputedValue for i32
[src]

[src]

[src]

impl ToComputedValue for u8
[src]

[src]

[src]

impl ToComputedValue for u16
[src]

[src]

[src]

impl ToComputedValue for u32
[src]

[src]

[src]

impl ToComputedValue for Cursor
[src]

[src]

[src]

impl ToComputedValue for String
[src]

[src]

[src]

impl ToComputedValue for Box<str>
[src]

[src]

[src]

Implementors