Skip to main content

IAnimationInstance

Trait IAnimationInstance 

Source
pub trait IAnimationInstance: IServerClockItem + 'static {
    // Required methods
    fn target_object(&self) -> ServerObjectId;
    fn evaluate(
        &self,
        now: Duration,
        current_value: ExpressionVariant,
    ) -> ExpressionVariant;
    fn initialize(
        &self,
        started_at: Duration,
        starting_value: ExpressionVariant,
        property: &'static CompositionProperty,
    );
    fn activate(&self);
    fn deactivate(&self);
    fn invalidate(&self);

    // Provided method
    fn resolve(&self, _compositor: &Rc<ServerCompositor>) { ... }
}
Expand description

A running animation of one property of a server object.

An instance is created on the UI thread by the animation it belongs to, crosses to the server in the batch that starts it, and is driven there. It names its target, and the objects its reference parameters refer to, by id: the UI thread never holds a server object. The ids are resolved on the server by resolve, which the animations of the target call before initialize.

Required Methods§

Source

fn target_object(&self) -> ServerObjectId

The object whose property is animated.

Source

fn evaluate( &self, now: Duration, current_value: ExpressionVariant, ) -> ExpressionVariant

The value of the animation at now.

Source

fn initialize( &self, started_at: Duration, starting_value: ExpressionVariant, property: &'static CompositionProperty, )

Attaches the instance to the property it animates.

Source

fn activate(&self)

Source

fn deactivate(&self)

Source

fn invalidate(&self)

Provided Methods§

Source

fn resolve(&self, _compositor: &Rc<ServerCompositor>)

Resolves the server objects the instance refers to by id, on the compositor that drives it. Called once, on the server, before the instance is initialized; an instance that refers to no object needs nothing.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§