Skip to main content

Crate serge_native

Crate serge_native 

Source
Expand description

serge-native — the native runtime shared by every native platform and by headless tests: it mounts Elements into a retained tree, keeps it in sync with signals, lays it out (serge-native-layout), shapes text (serge-native-text), collects ScenePrimitives for the GPU/CPU renderers, routes input, and runs UI tasks (LocalExecutor).

Headless drives the same runtime without a window (tests, CI).

Re-exports§

pub use accesskit;

Structs§

Font
The font type behind FontHandle on native targets. Owned shareable font resource.
Headless
The UI without a window: the native runtime, the CPU-side scene and simulated input, for tests (docs/01-dx-and-dsl.md §2, 헤드리스 통합 테스트).
LocalExecutor
Runs UI tasks; the host calls run_ready when notified.
Ui
A mounted UI: its tree, text system and input state. One per window.

Enums§

Backend
The renderer a window uses (docs/03-adapters-and-pipeline.md §1.2).
BackendError
Why no renderer could be chosen.
Key
A key that is not text.

Functions§

choose_backend
The fallback policy as a pure function: an explicit requested value (HYPERISH_RENDER_BACKEND) always wins and an explicit gpu that fails is an error; without one, headless runs use the CPU and windows try the GPU, falling back to the CPU when gpu() fails.
requested_backend
The backend requested (HYPERISH_RENDER_BACKEND) names: None when unset or empty, an error when it names neither cpu nor gpu.
yield_now
A future that is ready after polling returns Pending once (yields to other tasks).