Expand description
Attaching a super::CommandRunner to an ambient execution context.
Ported from internal/executor/context.go.
Go’s context.Context is an explicit value threaded through every
call, with context.WithValue/ctx.Value as a typed, per-request key/
value store. Rust has no first-class equivalent: the idiomatic
translation is usually to pass the CommandRunner explicitly (as a
function parameter or struct field) rather than smuggle it through an
ambient context object. This module is ported as a narrow
request-scoped container (Context) to preserve the ported tests’
shape during the red phase; Phase 4 should revisit whether callers can
be refactored to pass the runner explicitly instead. See
PORT_NOTES.md.
Structs§
- Context
- A narrow stand-in for Go’s
context.Contextcarrying a singleCommandRunnervalue. Unlike Go’s context tree, this does not support cancellation, deadlines, or arbitrary key/value nesting – those concerns are out of scope for this port (seePORT_NOTES.md). - ErrRunner
Missing - Ported from
ErrRunnerMissing.
Functions§
- from_
context - Ported from
FromContext. Panics withErrRunnerMissingif no runner is on the context, matching the Go behavior. - with_
context - Ported from
WithContext.