pub trait PropertyInstance<T>
where T: Default + Clone,
{ // Required methods fn get(&self) -> &T; fn get_mut(&mut self) -> &mut T; fn _get_vtable_id(&self) -> Option<usize>; fn set(&mut self, value: T); fn _get_transition_manager(&mut self) -> Option<&mut TransitionManager<T>>; fn ease_to( &mut self, new_value: T, duration_frames: u64, curve: EasingCurve ); fn ease_to_later( &mut self, new_value: T, duration_frames: u64, curve: EasingCurve ); fn property_type(&self) -> PropertyType; }
Expand description

An abstract Property that may be either: Literal, a dynamic runtime Expression, or a Timeline-bound value

Required Methods§

source

fn get(&self) -> &T

source

fn get_mut(&mut self) -> &mut T

source

fn _get_vtable_id(&self) -> Option<usize>

source

fn set(&mut self, value: T)

source

fn _get_transition_manager(&mut self) -> Option<&mut TransitionManager<T>>

Used by engine to gain access to this property’s transition queue

source

fn ease_to(&mut self, new_value: T, duration_frames: u64, curve: EasingCurve)

Immediately start transitioning from current value to the provided new_value, clearing the transition queue before doing so

source

fn ease_to_later( &mut self, new_value: T, duration_frames: u64, curve: EasingCurve )

Add a transition to the transition queue, which will execute after the current queue is complete. The starting value for this new transition will be the final value upon completion of the current transition queue.

source

fn property_type(&self) -> PropertyType

Trait Implementations§

source§

impl<T> Clone for Box<dyn PropertyInstance<T>>
where T: Default + Clone + 'static,

source§

fn clone(&self) -> Box<dyn PropertyInstance<T>>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T> Debug for Box<dyn PropertyInstance<T>>
where T: Default + Debug + Clone + 'static,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<T> Default for Box<dyn PropertyInstance<T>>
where T: Default + Clone + 'static,

source§

fn default() -> Box<dyn PropertyInstance<T>>

Returns the “default value” for a type. Read more
source§

impl<'de, T> Deserialize<'de> for Box<dyn PropertyInstance<T>>
where T: Deserialize<'de> + Default + Clone + 'static,

source§

fn deserialize<D>( deserializer: D ) -> Result<Box<dyn PropertyInstance<T>>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<T> Serialize for Box<dyn PropertyInstance<T>>
where T: Serialize + Default + Clone + 'static,

source§

fn serialize<S>( &self, serializer: S ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

Implementors§