pub struct ExecutionContext {
pub exec_id: u64,
pub stop: Arc<AtomicBool>,
pub observer: Option<Arc<dyn RunObserver>>,
pub scene_tree: ArcSwapOption<RwLock<SceneTree>>,
pub channel: Option<Arc<dyn OutputChannel>>,
}Expand description
Per-execution context (SRD-88 §3). Grows as the de-globalization proceeds;
Push 1 carries the exec_id, the per-execution stop flag, and the
per-execution observer (display/lifecycle routing).
Fields§
§exec_id: u64This execution’s id — the partition key for its metrics, log lines, and checkpoint events in the shared session store (SRD-77).
stop: Arc<AtomicBool>This execution’s stop flag. A stop scoped here halts this execution
only; a global Ctrl-C (session_signals::SESSION_STOP) still halts
every execution (see crate::session_signals::stop_requested).
observer: Option<Arc<dyn RunObserver>>This execution’s observer (lifecycle + log routing). None falls back
to the process-global GLOBAL_OBSERVER (axiom A1) — so a context with
no observer set behaves exactly as the single-run path.
scene_tree: ArcSwapOption<RwLock<SceneTree>>This execution’s scene tree (its own scenario structure + lifecycle
status). Late-bound: the pre-map walker installs it during the
run, so it is interior-mutable. Empty until installed; reads fall back
to the process-global GLOBAL_TREE (A1). The session is the common
root (SRD-88) — each execution’s tree derives from the shared session
scope; this slot holds the per-execution derived structure.
channel: Option<Arc<dyn OutputChannel>>This execution’s output channel (SRD-87 op-output / log / status /
raster buckets). None falls back to the process-global CHANNEL
(axiom A1). A concurrent in-process execution scopes its own (e.g. a
CaptureChannel) so its op stdout is captured per-execution instead of
colliding on the one process fd — what in-process example verification
needs to check expect regexes against each execution’s output.
Implementations§
Source§impl ExecutionContext
impl ExecutionContext
Sourcepub fn new() -> Arc<Self> ⓘ
pub fn new() -> Arc<Self> ⓘ
A fresh context with a freshly-allocated exec_id and its own stop
flag, no per-execution observer (falls back to the global — A1).
Sourcepub fn with_observer(observer: Arc<dyn RunObserver>) -> Arc<Self> ⓘ
pub fn with_observer(observer: Arc<dyn RunObserver>) -> Arc<Self> ⓘ
A fresh context that routes lifecycle/log through its own observer
instead of the process-global. Used by concurrent executions so each
folds its own outcome independently.
Sourcepub fn with_observer_and_channel(
observer: Arc<dyn RunObserver>,
channel: Arc<dyn OutputChannel>,
) -> Arc<Self> ⓘ
pub fn with_observer_and_channel( observer: Arc<dyn RunObserver>, channel: Arc<dyn OutputChannel>, ) -> Arc<Self> ⓘ
A fresh context routing both lifecycle/log (observer) AND the SRD-87
output buckets (channel) through its own per-execution sinks. Used by
in-process example verification so each concurrent execution’s op stdout
is captured separately.
Auto Trait Implementations§
impl !Freeze for ExecutionContext
impl !RefUnwindSafe for ExecutionContext
impl !UnwindSafe for ExecutionContext
impl Send for ExecutionContext
impl Sync for ExecutionContext
impl Unpin for ExecutionContext
impl UnsafeUnpin for ExecutionContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more