Skip to main content

Module runtime

Module runtime 

Source
Expand description

Runtime resource handle + ComponentTimerKind. Runtime resource handle threaded into every dispatch_atomic call.

The engine constructs a RuntimeResourceRef by split-borrowing the framework-primitive bundle + the bus before each dispatch_atomic call. Each field is a distinct &mut, so the borrow checker enforces field-level exclusivity — an Op may touch any subset.

Async-completing impls call ctx.complete_command(cmd_id, results); the engine drains pending_completions after the hook returns and routes them through handle_completion.

Structs§

ComponentTimerKind
Component-scheduled timer kind. Used by ProtocolRuntime::on_timer: protocol impls schedule timers via ctx.time.scheduler and receive the matured timer back via this newtype.
ComponentsView
Read-only view onto sibling components registered on the Node. Constructed by the engine at dispatch time from &engine.components + &engine.slots. The Vec is indexed by ComponentRef.as_u32() as usize; the slot the currently- dispatching component lives in is None for the duration of the dispatch (take-and-restore in invoke_atomic), so callers can’t accidentally re-enter themselves.
CurrentCallCtx
State scoped to the currently-dispatching op (NodeProto-level metadata, the op’s identity, completion drain, command-id mint).
InboundCtx
Inbound-envelope context captured at delivery time and threaded into every op dispatched as part of the cascade.
NetCtx
Network/transport state borrowed mutably during dispatch.
PeerCtx
Per-peer state borrowed mutably during dispatch.
PendingCompletion
Captured async-completion payload. The engine drains these from the post-dispatch RuntimeResourceRef and routes them through Engine::handle_completion.
RuntimeResourceRef
Engine-resource handle threaded into every dispatch_atomic call. Per docs/ENGINE.md §10. Fields are grouped by concern - peers/net/time/syscall carry the framework primitive references; current carries per-op state; bus/ingress stay top-level; components exposes the cross-component read-only surface.
SyscallCtx
Syscall-side state (storage, RNG, latches, app-event drain).
TimeCtx
Time / scheduling state borrowed mutably during dispatch.

Enums§

DependencyError
Errors surfaced by RuntimeResourceRef::dependency.