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: boolWhether 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: PluginContextTablePlugin contexts indexed by plugin ID. Thread this into the
next hook invocation to preserve per-plugin local_state.
Implementations§
Source§impl PipelineResult
impl PipelineResult
Sourcepub fn allowed_with(
payload: Box<dyn PluginPayload>,
extensions: Extensions,
context_table: PluginContextTable,
) -> Self
pub fn allowed_with( payload: Box<dyn PluginPayload>, extensions: Extensions, context_table: PluginContextTable, ) -> Self
Pipeline completed — all plugins allowed.
Sourcepub fn denied(
violation: PluginViolation,
extensions: Extensions,
context_table: PluginContextTable,
) -> Self
pub fn denied( violation: PluginViolation, extensions: Extensions, context_table: PluginContextTable, ) -> Self
Pipeline was denied by a plugin.
Sourcepub fn with_errors(self, errors: Vec<PluginErrorRecord>) -> Self
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.