pub trait ExecutableNode: Component {
type State;
const HAS_TICK: bool = true;
// 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<'_>) { ... }
}Provided Associated Constants§
Sourceconst HAS_TICK: bool = true
const HAS_TICK: bool = true
phase-521 W6 (RFC-0113 D2) — whether tick does any
work. A tick runs once per spin, so while any registered component
ticks the entry keeps a 10 ms spin cadence; once none does, the entry
parks until its next deadline or arrival. Defaults to true, the safe
reading for a component that overrides tick. A component with no
tick says false.
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".