Skip to main content

Module context

Module context 

Source
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.Context carrying a single CommandRunner value. 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 (see PORT_NOTES.md).
ErrRunnerMissing
Ported from ErrRunnerMissing.

Functions§

from_context
Ported from FromContext. Panics with ErrRunnerMissing if no runner is on the context, matching the Go behavior.
with_context
Ported from WithContext.