Skip to main content

Crate problemo

Crate problemo 

Source
Expand description

crates.io docs.rs

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

§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 str representation for Display.
static_string_attachment
Define a &'static str attachment 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.
CauseComparison
Cause comparison attachment.
CauseEquality
Cause equality attachment.
CauseRef
Reference to a Cause.
CauseRefIterator
CauseRef iterator.
ErrorSourceIterator
Iterator for an Error and its source chain.
FailFast
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.
ProblemAsError
Straightforward wrapper for Problem that adds an implementation of Error.
ProblemSinkFailFastWrapper
Problem sink wrapper that fails fast on an error type.
ProblemSinkIgnoreWrapper
Problem sink wrapper that ignores an error type.
ProblemSinkTokioSendSyncReftokio
Reference type for ProblemSink with Send and Sync for tokio.
ProblemSinkTokioSyncReftokio
Reference type for ProblemSink with Sync for tokio.
Problems
A simple wrapper for a vector of problems.
SerdeProblemserde
Problem with support for ser::Error and de::Error.
WeaklyComparableProblem
Allows for weak problem comparison.
WeaklyComparableProblemRef
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§

AnyhowIntoProblemanyhow
Into problem.
AnyhowIntoProblemResultanyhow
Into Result<_, Problem>.
Attachments
Access to attachments.
AttachmentsMut
Mutable access to attachments.
Causes
Access to causes.
Errors
Access to errors.
FromSerdeProblemResultserde
Maps a SerdeProblem Err into a Problem.
IntoProblem
Into a Problem.
IntoSerdeProblemserde
Convert into a SerdeProblem.
IntoSerdeProblemResultserde
Maps Err into a SerdeProblem.
IterateErrorSources
Iterate the Error::source chain.
ProblemImplementation
Problem implementation.
ProblemResult
Problemo extensions for Result.
ProblemSink
A problem sink.
ProblemSinkAsRef
As problem sink reference.
ProblemSinkAsSendSyncRef
As problem sink reference with Send and Sync.
ProblemSinkAsTokioSendSyncReftokio
As problem sink reference with Send and Sync for tokio.
ProblemSinkAsTokioSyncReftokio
As problem sink reference with Sync for tokio.
ProblemSinkResult
Problem sink result.
ProblemSinkSend
ProblemSink with Send.
ProblemSinkWrap
Wrap a problem sink.
ResultIntoProblem
Maps Err into a Problem.
WasmtimeIntoProblemwasmtime
Into problem.
WasmtimeIntoProblemResultwasmtime
Into Result<_, Problem>.

Functions§

iter_unique_problem_refs
Iterate unique problem references.
iter_unique_problems
Iterate unique problems.

Type Aliases§

CapturedAttachment
Captured attachment.
CapturedError
Captured Error.
ProblemSinkRef
Common reference type for ProblemSink.
ProblemSinkSendSyncRef
Common reference type for ProblemSink with Send and Sync.
ProblemSinkSyncRef
Common reference type for ProblemSink with Sync.