pub trait ExecutableNode: Node {
type State;
// Required methods
fn init() -> Self::State;
fn on_callback(
state: &mut Self::State,
callback: Callback<'_>,
ctx: &mut CallbackCtx<'_>,
);
// Provided method
fn tick(_state: &mut Self::State, _ctx: &mut TickCtx<'_>) { ... }
}Required Associated Types§
Required Methods§
Sourcefn on_callback(
state: &mut Self::State,
callback: Callback<'_>,
ctx: &mut CallbackCtx<'_>,
)
fn on_callback( state: &mut Self::State, callback: Callback<'_>, ctx: &mut CallbackCtx<'_>, )
Run the body for callback. ctx exposes the triggering payload + the
immediate publish path. Bodies match on the source callback name declared
by create_*_for_callback_name and related helpers.
Provided Methods§
Sourcefn tick(_state: &mut Self::State, _ctx: &mut TickCtx<'_>)
fn tick(_state: &mut Self::State, _ctx: &mut TickCtx<'_>)
Per-spin execution hook (W.5.6), run between callback dispatch by the
generated runtime — where the executor is free, so this is the only place
a component can complete action goals / publish feedback (via ctx) or do
periodic work. Default: no-op (timer/sub/service-only components).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.