AnimationEngine

Trait AnimationEngine 

Source
pub trait AnimationEngine {
    // Required methods
    fn is_available(&self) -> bool;
    fn animate(
        &mut self,
        animation: &AnimationConfig,
    ) -> Result<AnimationHandle, AnimationError>;
    fn stop(&mut self, handle: AnimationHandle) -> Result<(), AnimationError>;
    fn pause(&mut self, handle: AnimationHandle) -> Result<(), AnimationError>;
    fn resume(&mut self, handle: AnimationHandle) -> Result<(), AnimationError>;
    fn tick(&mut self, timestamp: f64) -> Result<(), AnimationError>;
    fn get_state(
        &self,
        handle: AnimationHandle,
    ) -> Result<PlaybackState, AnimationError>;
    fn is_running(&self, handle: AnimationHandle) -> bool;
    fn get_performance_metrics(&self) -> Option<()>;
}
Expand description

Core animation engine trait

Required Methods§

Source

fn is_available(&self) -> bool

Check if this engine is available in current environment

Source

fn animate( &mut self, animation: &AnimationConfig, ) -> Result<AnimationHandle, AnimationError>

Start an animation and return a handle

Source

fn stop(&mut self, handle: AnimationHandle) -> Result<(), AnimationError>

Stop an animation by handle

Source

fn pause(&mut self, handle: AnimationHandle) -> Result<(), AnimationError>

Pause an animation

Source

fn resume(&mut self, handle: AnimationHandle) -> Result<(), AnimationError>

Resume a paused animation

Source

fn tick(&mut self, timestamp: f64) -> Result<(), AnimationError>

Update all animations (for RAF-based engines)

Source

fn get_state( &self, handle: AnimationHandle, ) -> Result<PlaybackState, AnimationError>

Get current playback state

Source

fn is_running(&self, handle: AnimationHandle) -> bool

Check if an animation is running

Source

fn get_performance_metrics(&self) -> Option<()>

Get performance metrics (no-op when feature disabled)

Implementors§