Skip to main content

HookEvent

Enum HookEvent 

Source
pub enum HookEvent<'a> {
    BeforeStep {
        step_name: &'a str,
        metadata: &'a OperationMetadata,
        params: &'a Parameters,
        iter_context: Option<&'a IterContext<'a>>,
    },
    AfterStep {
        step_name: &'a str,
        metadata: &'a OperationMetadata,
        params: &'a Parameters,
        operation_outputs: &'a Store<StoreEntry>,
        global_outputs: &'a Store<StoreEntry>,
        iter_context: Option<&'a IterContext<'a>>,
    },
    BeforeIteration {
        iter_context: &'a IterContext<'a>,
    },
    AfterIteration {
        iter_context: &'a IterContext<'a>,
    },
    BeforeReturns {
        return_name: &'a str,
        params: &'a Parameters,
    },
    AfterReturns {
        return_name: &'a str,
        params: &'a Parameters,
        outputs: &'a Store<StoreEntry>,
    },
    GuardPassed {
        guard_name: &'a str,
    },
    GuardFailed {
        guard_name: &'a str,
    },
    Complete,
    Error {
        error: &'a OperationError,
    },
}
Expand description

A structured event fired during pipeline execution.

HookEvent is the input to every Hook callback. The variants mirror the runtime’s timeline: Before* events fire immediately before the associated action, After* events fire immediately after, and Complete / Error bracket the end of the run. The borrowed references let hooks inspect step metadata, parameters, and outputs without cloning.

Variants§

§

BeforeStep

Fires immediately before a step’s operation runs. Parameters have been resolved but no outputs have been staged yet.

Fields

§step_name: &'a str

The step’s name (prefixed if inside a child pipeline).

§metadata: &'a OperationMetadata

The operation’s static metadata.

§params: &'a Parameters

The unresolved parameters as declared at draft time.

§iter_context: Option<&'a IterContext<'a>>

Present when the step is nested inside an iteration.

§

AfterStep

Fires immediately after a step’s operation runs. Operation outputs and global outputs are staged but not yet merged into the runtime store.

Fields

§step_name: &'a str

The step’s name.

§metadata: &'a OperationMetadata

The operation’s static metadata.

§params: &'a Parameters

The unresolved parameters.

§operation_outputs: &'a Store<StoreEntry>

Outputs scoped to the operation only (not merged into the runtime store).

§global_outputs: &'a Store<StoreEntry>

Outputs about to be merged into the runtime store.

§iter_context: Option<&'a IterContext<'a>>

Present when the step is nested inside an iteration.

§

BeforeIteration

Fires before each iteration body executes.

Fields

§iter_context: &'a IterContext<'a>

The current iteration’s context.

§

AfterIteration

Fires after each iteration body finishes.

Fields

§iter_context: &'a IterContext<'a>

The current iteration’s context.

§

BeforeReturns

Fires before a return block resolves its parameters.

Fields

§return_name: &'a str

The return block’s name.

§params: &'a Parameters

The unresolved parameters.

§

AfterReturns

Fires after a return block resolves its parameters.

Fields

§return_name: &'a str

The return block’s name.

§params: &'a Parameters

The unresolved parameters.

§outputs: &'a Store<StoreEntry>

The returns store with the resolved values.

§

GuardPassed

Fires when a guard’s boolean source evaluates to true. The guard body is about to execute.

Fields

§guard_name: &'a str

The guard node’s name.

§

GuardFailed

Fires when a guard’s boolean source evaluates to false. The guard body is skipped.

Fields

§guard_name: &'a str

The guard node’s name.

§

Complete

Fires once at the end of a successful run, after all return blocks have resolved.

§

Error

Fires once when the worker thread produces an error. The pipeline is about to fail.

Fields

§error: &'a OperationError

The error the worker is propagating.

Trait Implementations§

Source§

impl<'a> Debug for HookEvent<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for HookEvent<'a>

§

impl<'a> RefUnwindSafe for HookEvent<'a>

§

impl<'a> Send for HookEvent<'a>

§

impl<'a> Sync for HookEvent<'a>

§

impl<'a> Unpin for HookEvent<'a>

§

impl<'a> UnsafeUnpin for HookEvent<'a>

§

impl<'a> UnwindSafe for HookEvent<'a>

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, 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.