Skip to main content

Crate cranpose_runtime_std

Crate cranpose_runtime_std 

Source
Expand description

§Cranpose Runtime Std

cranpose-runtime-std implements Cranpose’s clock and scheduler contracts with Rust standard-library services. App-shell and custom host authors use StdRuntime to supply a cranpose_core::Runtime. App developers use cranpose::AppLauncher, which wires the runtime into a platform shell.

§Drive runtime callbacks

A host polls for scheduled frames and drains callbacks with the platform frame timestamp:

use cranpose_runtime_std::StdRuntime;

fn on_frame(runtime: &StdRuntime, frame_time_nanos: u64) {
    if runtime.take_frame_request() {
        runtime.drain_frame_callbacks(frame_time_nanos);
    }
}

Native hosts can connect set_frame_waker to their event loop. The internal feature exposes StdRuntime::frame_clock for framework integration. Default features are empty. See the StdRuntime API, the app-shell source and the crate source.

Structs§

StdClock
Clock implementation backed by a cross-platform monotonic timer.
StdRuntime
Convenience container bundling the standard scheduler and clock.
StdScheduler
Scheduler that delegates work to Rust’s threading primitives.

Type Aliases§

StdSchedulerRef
Shared handle to a StdScheduler.