Skip to main content

Module runtime

Module runtime 

Source
Expand description

Async runtime and event-channel integration for egui applications.

Re-exports§

pub use payload::Payload;
pub use service::Service;
pub use service::ServiceResult;

Modules§

channel
Repaint-aware async channel types used to communicate with the UI thread.
events
Runtime and application event types delivered through the event loop.
panic
Panic hooks that log application panics and trigger shutdown.
payload
Globally-registered, shareable payload slots for passing data between tasks.
service
The Service trait for long-running runtime components.
signals
OS signal handling (e.g. graceful shutdown on Ctrl-C / SIGTERM).

Structs§

Inner
Shared inner state of the Runtime, held behind an Arc so that runtime handles can be cloned cheaply.
Runtime
Cheaply cloneable handle to the application runtime, providing access to services, the egui context, and the application events channel.

Functions§

runtime
Returns a clone of the globally registered Runtime.
spawn
Spawn an async task that will result in egui redraw upon its completion.
spawn_with_result
Spawn an async task that will result in egui redraw upon its completion. Upon the task completion, the supplied Payload will be populated with the task result.
try_runtime
Returns a clone of the global Runtime if it has been initialized, or None otherwise.