Skip to main content

AppHook

Type Alias AppHook 

Source
pub type AppHook = Box<dyn FnOnce(&mut App) + 'static>;
Expand description

An embedder callback invoked on the fully-built App right before the window event loop starts. Every default plugin and system is already registered at that point, so a hook can insert resources and add systems ordered against the default stack’s public systems (for example .before(lumen_core::signals::apply_text_bindings)).

The Rust SDK (sdk/rust, crate lumenui) uses it to wire Rust-closure event handlers and whole bevy_ecs systems into the tick without lumenc knowing about them.

Not Send: hooks are drained and invoked in build_app on the calling thread (see the loop near the end of that fn), never moved across threads. The bound is intentionally omitted so the SDK can defer IntoScheduleConfigs values - system.chain() / system.run_if(..) box into !Send ScheduleConfigs, which a Send hook could not capture.

Aliased Type§

pub struct AppHook(/* private fields */);