pub enum OpDispatch {
Stateless(fn(&NodeProto, &[(&str, &(dyn SlotValue + 'static))], &mut RuntimeResourceRef<'_>) -> Result<DispatchResult, OpError>),
Atomic {
component_ref: ComponentRef,
dispatch_fn: fn(&mut (dyn Any + 'static), &str, &[(&str, &(dyn SlotValue + 'static))], &mut RuntimeResourceRef<'_>) -> Result<DispatchResult, String>,
},
FunctionCall {
target: (String, String, String),
input_rename: Rc<[(String, String)]>,
output_rename: Rc<[(String, String)]>,
},
Unresolved,
}Expand description
Per-OpRef dispatch decision, pre-stamped at install time by
Engine::resolve_dispatch. Runtime invoke is one indirect probe
against GraphSlot.op_dispatch[idx]. Four variants:
Stateless- framework syscall.Atomic- bound runtime’sdispatch_atomic.FunctionCall- splice into another installed function’s body via sharedOpRefs, with input/output rename for call-frame semantics. Seedocs/ENGINE.md§8.4.Unresolved- sentinel for nodes whose dispatch couldn’t be resolved at install. Build fails if any survive.
Variants§
Stateless(fn(&NodeProto, &[(&str, &(dyn SlotValue + 'static))], &mut RuntimeResourceRef<'_>) -> Result<DispatchResult, OpError>)
Framework syscall.
Atomic
Bound runtime impl, routed via components[component_ref].
dispatch_fn is the install-time-stamped downcast closure
from Engine::role_dispatchers[component_type_id]. Runtime
invoke calls the closure directly; resolve_dispatch only
stamps Atomic when the closure is available, otherwise it
stamps Unresolved. Test fixtures that bypass install
stamp the closure manually via bind_slot_id +
register_<role>_dispatcher before resolve_dispatch.
Fields
component_ref: ComponentRefComponentRef of the bound impl.
dispatch_fn: fn(&mut (dyn Any + 'static), &str, &[(&str, &(dyn SlotValue + 'static))], &mut RuntimeResourceRef<'_>) -> Result<DispatchResult, String>Pre-stamped downcast closure that calls the concrete
<Role>Runtime::dispatch_atomic on the bound component.
FunctionCall
Function-call to another installed function. target keys
into engine.graphs (the symbol table); input_rename /
output_rename map caller-side ↔ formal value names.
Fields
Unresolved
Sentinel for unresolved dispatch - set by from_function
before resolve, replaced by resolve_dispatch. Build fails if
any survive past resolution.
Trait Implementations§
Source§impl Clone for OpDispatch
impl Clone for OpDispatch
Source§fn clone(&self) -> OpDispatch
fn clone(&self) -> OpDispatch
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more