Expand description
Error context management and accumulation Helpers for attaching rich context metadata to errors.
Key features:
with_context/with_context_resultwrap anyResultwhile preserving structuredErrorContextvalues.ErrorPipelineenables chaining operations, collecting pending contexts, and mapping/recovering errors before finalizing into aComposableError.- Convenience builders such as
context_fn,accumulate_context, andcontext_accumulatorlet you compose context-aware closures.
See the crate-level docs for a high-level overview of when to prefer these
utilities over bare Result transformations.
Functionsยง
- accumulate_
context - Wraps an error with multiple context entries at once.
- context_
accumulator - Creates a reusable closure that wraps errors with multiple contexts.
- context_
fn - Creates a reusable closure that wraps errors with a fixed context.
- error_
pipeline - Creates an
ErrorPipelinefrom a result. - extract_
context - Extracts all context entries from a
ComposableError. - format_
error_ chain - Formats a
ComposableErroras a human-readable error chain. - with_
context - Wraps an error with a single context entry.
- with_
context_ result - Transforms a
Resultby adding context to any error.