Skip to main content

ProjectRuntimeExt

Trait ProjectRuntimeExt 

Source
pub trait ProjectRuntimeExt {
    // Required methods
    fn show(self) -> Result<()>;
    fn export(&mut self) -> Result<()>;
}
Expand description

Extension trait to provide ergonomic runtime methods to Project.

This trait keeps the core Project struct free of side-effects while allowing for a simple .show() or .export() API.

Required Methods§

Source

fn show(self) -> Result<()>

Opens the playback window for the project.

This will initialize a winit event loop and a Vello renderer to provide an interactive preview of the animation.

§Example
project.show().expect("Failed to open window");
Source

fn export(&mut self) -> Result<()>

Starts an export session for the project.

This will render every frame of the project at full resolution and save them to the configured output path.

§Example
project.export().expect("Failed to export project");

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§