Skip to main content

RunContext

Struct RunContext 

Source
pub struct RunContext<'a, F, S, O>{
    pub fs: &'a F,
    pub cache: &'a Cache<F>,
    pub spawner: &'a S,
    pub observer: &'a O,
    pub workspace: &'a Workspace,
    pub graph: &'a TaskGraph,
    pub host_env: &'a BTreeMap<EnvVarName, String>,
    pub algo: HashAlgo,
    pub cancel: &'a CancellationToken,
}
Expand description

Borrowed bundle of long-lived state that every run_task invocation in a given haz run shares.

The split between this context and the per-task arguments matches a scheduler’s natural shape: one RunContext covers the entire scheduling loop, while task, predecessor_streams, and created_at_unix change between individual run_task calls.

Fields§

§fs: &'a F

Filesystem the executor reads inputs / outputs / cache state through.

§cache: &'a Cache<F>

Cache handle (lookup, restore, store).

§spawner: &'a S

Process spawner (a test-double mock under cfg(test), crate::std_impl::StdProcessSpawner in production).

§observer: &'a O

Observer that receives lifecycle events and captured streams.

§workspace: &'a Workspace

Validated workspace state.

§graph: &'a TaskGraph

Validated dependency graph.

§host_env: &'a BTreeMap<EnvVarName, String>

Host-environment snapshot. Names not present here are treated as absent per CACHE-008.

§algo: HashAlgo

Active hash algorithm for cache-key derivation, input / output content hashing, and captured-stream hashing.

§cancel: &'a CancellationToken

Cancellation signal for the run (EXEC-012 triggers). The scheduler and per-task spawn-step futures observe this token: when it fires, the scheduler stops admitting new tasks and in-flight futures send SIGTERM to their children. The token is long-lived ambient state owned by the run’s caller (typically haz-cli installing an OS signal handler); tests pass a never-cancelled token.

Auto Trait Implementations§

§

impl<'a, F, S, O> Freeze for RunContext<'a, F, S, O>

§

impl<'a, F, S, O> RefUnwindSafe for RunContext<'a, F, S, O>

§

impl<'a, F, S, O> Send for RunContext<'a, F, S, O>
where F: Sync, S: Sync, O: Sync,

§

impl<'a, F, S, O> Sync for RunContext<'a, F, S, O>
where F: Sync, S: Sync, O: Sync,

§

impl<'a, F, S, O> Unpin for RunContext<'a, F, S, O>

§

impl<'a, F, S, O> UnsafeUnpin for RunContext<'a, F, S, O>

§

impl<'a, F, S, O> UnwindSafe for RunContext<'a, F, S, O>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V