Skip to main content

PipelineResult

Struct PipelineResult 

Source
pub struct PipelineResult {
    pub continue_processing: bool,
    pub modified_payload: Option<Box<dyn PluginPayload>>,
    pub modified_extensions: Option<Extensions>,
    pub violation: Option<PluginViolation>,
    pub errors: Vec<PluginErrorRecord>,
    pub metadata: Option<Value>,
    pub context_table: PluginContextTable,
}
Expand description

Aggregate result from a full hook invocation across all phases.

Wraps the final payload, extensions, any violation, and the context table. Immutable by design — policy decisions cannot be tampered with after the executor returns them.

The caller should pass context_table into the next hook invocation to preserve per-plugin local state across hooks in the same request lifecycle.

Background tasks are returned separately as BackgroundTasks to keep the policy result immutable.

Fields§

§continue_processing: bool

Whether the pipeline should continue processing. false means a plugin denied — the pipeline was halted.

§modified_payload: Option<Box<dyn PluginPayload>>

The final payload after all modifications (type-erased). None if the pipeline was denied before any modifications.

§modified_extensions: Option<Extensions>

The final extensions after all modifications. None if no plugin modified extensions.

§violation: Option<PluginViolation>

The violation that caused a deny, if any.

§errors: Vec<PluginErrorRecord>

Errors from plugins that ran with on_error: ignore or on_error: disable. These plugins didn’t halt the pipeline (their on_error policy said to continue), but the caller should still know the errors happened so it can log them in a structured way, retry the affected plugin, or alert. Empty when no plugin errored on a non-halt path. Fire-and-forget errors live in BackgroundTasks instead.

§metadata: Option<Value>

Optional metadata aggregated from plugins (telemetry, diagnostics).

§context_table: PluginContextTable

Plugin contexts indexed by plugin ID. Thread this into the next hook invocation to preserve per-plugin local_state.

Implementations§

Source§

impl PipelineResult

Source

pub fn allowed_with( payload: Box<dyn PluginPayload>, extensions: Extensions, context_table: PluginContextTable, ) -> Self

Pipeline completed — all plugins allowed.

Source

pub fn denied( violation: PluginViolation, extensions: Extensions, context_table: PluginContextTable, ) -> Self

Pipeline was denied by a plugin.

Source

pub fn with_errors(self, errors: Vec<PluginErrorRecord>) -> Self

Replace the errors vec on a constructed PipelineResult. Used by the executor to attach errors collected from on_error: ignore / on_error: disable plugins.

Source

pub fn is_denied(&self) -> bool

Whether this result represents a denial.

Trait Implementations§

Source§

impl Debug for PipelineResult

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more