Skip to main content

AnimatableField

Trait AnimatableField 

Source
pub trait AnimatableField<T> {
    // Required methods
    fn static_val(&self) -> Option<T>
       where T: Copy;
    fn static_ref(&self) -> Option<&T>;
    fn static_or_seed(&self) -> Option<T>
       where T: Copy;
    fn binding(&self) -> Option<&Binding>;
}
Expand description

Read helpers for the Option<Animatable<T>> style fields, so read sites stay as terse as the plain Option<T> they replaced.

Required Methods§

Source

fn static_val(&self) -> Option<T>
where T: Copy,

The static value by copy; None when absent or animated.

Source

fn static_ref(&self) -> Option<&T>

The static value by reference; None when absent or animated.

Source

fn static_or_seed(&self) -> Option<T>
where T: Copy,

The static value — or, while animated, the wrapper’s seed; None when absent or animated seed-less. The read helper for fields whose consumers should render the seed until a driver writes (SVG shape attrs); style read sites use Self::static_val instead (their animated fields read as absent by design).

Source

fn binding(&self) -> Option<&Binding>

The binding; None when absent or static.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T> AnimatableField<T> for Option<Animatable<T>>

Source§

fn static_val(&self) -> Option<T>
where T: Copy,

Source§

fn static_ref(&self) -> Option<&T>

Source§

fn static_or_seed(&self) -> Option<T>
where T: Copy,

Source§

fn binding(&self) -> Option<&Binding>

Implementors§