Skip to main content

run

Function run 

Source
pub fn run<B, A>(backend: B, app: A) -> Result<(), B::Error>
where B: Backend, A: App<B>,
Expand description

Builds a Terminal over backend and drives app with run_on.

The canonical entry point for a blocking-loop backend (Crossterm in retroglyph-crossterm, Headless, and any future backend with a loop it can enter and return from): construct the backend, hand it here with the app, and the terminal is built and owned for you. Backends whose control flow is inverted (winit owns the loop) or push-driven (wasm’s requestAnimationFrame) keep their own drivers instead; see this module’s doc comment for that split.

§Errors

Returns backend’s error if it fails to build a Terminal over itself, or if the automatic present() call fails while app is running. See run_on for the exact loop behavior.