Crate woah

source · []
Expand description

woah is a Rust crate which provides the following type:

enum Result<T, L, F> {
    Success(T),
    LocalErr(L),
    FatalErr(F),
}

This type differentiates between “local errors” which can be handled and “fatal errors” which can’t, to enable the error handling pattern described by Tyler Neely (@spacejam) in the blog post “Error Handling in a Correctness-Critical Rust Project”. woah::Result is intended to be a more ergonomic alternative to the Result<Result<T, LocalError>, FatalError> type proposed in the post.

The important thing to note is that using the question mark operator on woah::Result causes any FatalError to propagate up, while providing Result<T, LocalError> otherwise, to enable the local code to handle local errors without propagating them.

For more details, read the docs module.

Modules

Documentation, including crate features and examples.

A collection of re-exports to make woah::Result the standard result type.

Structs

An iterator over the value in an Success variant of a woah::Result.

An iterator over a reference to the Success variant of a woah::Result.

An iterator over a mutable reference to the Success variant of a woah::Result.

Enums

A type representing success (Success), a local error (LocalErr), or a fatal error (FatalErr).