Expand description
§Problemo
This library aims to improve the experience of working with Rust’s std Error trait by allowing for deep causation chains, arbitrary attachments, and error accumulation with the goal of making it easy and rewarding to return richly-typed errors for callers to inspect and handle.
§Documentation
These pages will give you a tour of Problemo’s design and features. The examples will show you how to use it in practice.
- 1. Causation Chains
- 2. Attachments
- 3. Error Accumulation
- Frequently Asked Questions
- API documentation
§License
Licensed under your choice of either
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
All code and documentation was written by humans. We do not accept “AI”-generated contributions.
Re-exports§
pub use backtrace;backtrace-external
Modules§
- common
- Common error and attachment types.
Macros§
- attachment
- Define an attachment type.
- gloss_
error - Define an error type with a String representation for Display.
- report_
unwrap - Like Result::unwrap but reports Err to a ProblemSink and returns Ok if that error is swallowed.
- static_
gloss_ error - Define an error type with a
&'static strrepresentation for Display. - static_
string_ attachment - Define a
&'static strattachment type. - string_
attachment - Define a String attachment type.
- tag_
error - Define an error type implemented as an empty
struct.
Structs§
- Cause
- A link in a Problem’s causation chain.
- Cause
Comparison - Cause comparison attachment.
- Cause
Equality - Cause equality attachment.
- Cause
Ref - Reference to a Cause.
- Cause
RefIterator - CauseRef iterator.
- Error
Source Iterator - Iterator for an Error and its source chain.
- Fail
Fast - ProblemSink that fails on the first reported problem.
- NoProblem
- ProblemSink that discards all reported problems.
- Problem
- A problem is a simple wrapper for an error causation chain.
- Problem
AsError - Straightforward wrapper for Problem that adds an implementation of Error.
- Problem
Sink Fail Fast Wrapper - Problem sink wrapper that fails fast on an error type.
- Problem
Sink Ignore Wrapper - Problem sink wrapper that ignores an error type.
- Problem
Sink Tokio Send Sync Ref tokio - Reference type for ProblemSink with Send and Sync for tokio.
- Problem
Sink Tokio Sync Ref tokio - Reference type for ProblemSink with Sync for tokio.
- Problems
- A simple wrapper for a vector of problems.
- Serde
Problem serde - Problem with support for ser::Error and de::Error.
- Weakly
Comparable Problem - Allows for weak problem comparison.
- Weakly
Comparable Problem Ref - Allows for weak problem reference comparison.
Constants§
- AUTO_
ATTACH_ BACKTRACE - Environment variable to control the auto-attachment of a backtrace.
- AUTO_
ATTACH_ LOCATION - Environment variable to control the auto-attachment of a Location.
- GLOSS_
DISPLAY_ SEPARATOR - Separator for gloss Display.
- PROBLEMS_
DISPLAY_ PREFIX - Prefix for Problems Display.
- PROBLEM_
DISPLAY_ SEPARATOR - Separator for Problem Display.
Traits§
- Anyhow
Into Problem anyhow - Into problem.
- Anyhow
Into Problem Result anyhow - Into Result<_, Problem>.
- Attachments
- Access to attachments.
- Attachments
Mut - Mutable access to attachments.
- Causes
- Access to causes.
- Errors
- Access to errors.
- From
Serde Problem Result serde - Maps a SerdeProblem Err into a Problem.
- Into
Problem - Into a Problem.
- Into
Serde Problem serde - Convert into a SerdeProblem.
- Into
Serde Problem Result serde - Maps Err into a SerdeProblem.
- Iterate
Error Sources - Iterate the Error::source chain.
- Problem
Implementation - Problem implementation.
- Problem
Result - Problemo extensions for Result.
- Problem
Sink - A problem sink.
- Problem
Sink AsRef - As problem sink reference.
- Problem
Sink AsSend Sync Ref - As problem sink reference with Send and Sync.
- Problem
Sink AsTokio Send Sync Ref tokio - As problem sink reference with Send and Sync for tokio.
- Problem
Sink AsTokio Sync Ref tokio - As problem sink reference with Sync for tokio.
- Problem
Sink Result - Problem sink result.
- Problem
Sink Send - ProblemSink with Send.
- Problem
Sink Wrap - Wrap a problem sink.
- Result
Into Problem - Maps Err into a Problem.
- Wasmtime
Into Problem wasmtime - Into problem.
- Wasmtime
Into Problem Result wasmtime - Into Result<_, Problem>.
Functions§
- iter_
unique_ problem_ refs - Iterate unique problem references.
- iter_
unique_ problems - Iterate unique problems.
Type Aliases§
- Captured
Attachment - Captured attachment.
- Captured
Error - Captured Error.
- Problem
Sink Ref - Common reference type for ProblemSink.
- Problem
Sink Send Sync Ref - Common reference type for ProblemSink with Send and Sync.
- Problem
Sink Sync Ref - Common reference type for ProblemSink with Sync.