Skip to main content

RunApp

Trait RunApp 

Source
pub trait RunApp {
    type Event;
    type Error;

    // Required method
    fn run_step(
        &mut self,
        step: RunStep<'_, Self::Event>,
    ) -> Result<RunControl, Self::Error> ;
}
Expand description

App logic driven step-by-step by a runtime.


📍 run


A runtime or driver gathers events, builds a RunStep, and calls run_step to let the app update its state.

This trait only defines logical progression. It does not define rendering, pacing, or backend services.

Required Associated Types§

Source

type Event

The event type consumed by each runtime step.

Source

type Error

The error type returned by each runtime step.

Required Methods§

Source

fn run_step( &mut self, step: RunStep<'_, Self::Event>, ) -> Result<RunControl, Self::Error>

Advances the app by one runtime step.

Returns a RunControl indicating whether execution should continue or stop after the current step.

Returns an error if the step cannot be completed.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§