Trait StylePropReader

Source
pub trait StylePropReader {
    type State: Debug;
    type Type: Clone;

    // Required methods
    fn read(
        state: &mut Self::State,
        style: &Style,
        fallback: &Style,
        now: &Instant,
        request_transition: &mut bool,
    ) -> bool;
    fn get(state: &Self::State) -> Self::Type;
    fn new() -> Self::State;
}

Required Associated Types§

Required Methods§

Source

fn read( state: &mut Self::State, style: &Style, fallback: &Style, now: &Instant, request_transition: &mut bool, ) -> bool

Reads the property from the style. Returns true if the property changed.

Source

fn get(state: &Self::State) -> Self::Type

Source

fn new() -> Self::State

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<P: StyleProp> StylePropReader for Option<P>

Source§

type State = Option<<P as StyleProp>::Type>

Source§

type Type = Option<<P as StyleProp>::Type>

Source§

fn read( state: &mut Self::State, style: &Style, fallback: &Style, _now: &Instant, _transition: &mut bool, ) -> bool

Source§

fn get(state: &Self::State) -> Self::Type

Source§

fn new() -> Self::State

Implementors§