Skip to main content

NativeComposition

Trait NativeComposition 

Source
pub trait NativeComposition: Send + Sync {
    // Required methods
    fn id(&self) -> &str;
    fn render(
        &self,
        frame: u32,
        props: &Value,
        context: NativeCompositionContext,
    ) -> Result<Scene, CompositionError>;
}
Expand description

A browser-free Rust composition that produces one rasterizer scene per frame.

Applications can implement this trait, register implementations in a CompositionRegistry, and call execute_render_command_with_registry.

Required Methods§

Source

fn id(&self) -> &str

Source

fn render( &self, frame: u32, props: &Value, context: NativeCompositionContext, ) -> Result<Scene, CompositionError>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§