Skip to main content

Animation

Trait Animation 

Source
pub trait Animation: Send + Sync {
    // Required method
    fn frame(&self, tick: u64) -> String;

    // Provided methods
    fn is_complete(&self, tick: u64) -> bool { ... }
    fn frame_rate(&self) -> u32 { ... }
}
Expand description

Trait for creating animated terminal effects

Required Methods§

Source

fn frame(&self, tick: u64) -> String

Generate the frame for a given tick

Provided Methods§

Source

fn is_complete(&self, tick: u64) -> bool

Check if the animation has completed (for finite animations)

Source

fn frame_rate(&self) -> u32

Get the recommended frame rate (FPS)

Implementors§