Skip to main content

make_bootstrap_dispatcher

Function make_bootstrap_dispatcher 

Source
pub fn make_bootstrap_dispatcher<T: Bootstrap + 'static>() -> BootstrapDispatchFn
where T::Error: Display,
Expand description

Build a BootstrapDispatchFn for a concrete T: Bootstrap. Called from Engine::register_bootstrap_dispatcher so the engine’s fire_component_bootstrap lookup keys on TypeId::of::<T>() and the synthetic op invokes the user’s T::bootstrap directly.

The Contract method’s return is Result<(), T::Error>; this helper converts the Ok(()) to DispatchResult::Immediate(Vec::new()) because Component bootstrap declares no output slots — the F3 spec lists Async as a future option a Component’s override surfaces via a wrapping CommandId, but Commit 3 lands the synchronous-Immediate path that every default-no-op Bootstrap takes.