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.
Modules§
- docs
- Documentation, including crate features and examples.
- prelude
- A collection of re-exports to make
woah::Resultthe standard result type.
Structs§
- Into
Iter - An iterator over the value in an
Successvariant of awoah::Result. - Iter
- An iterator over a reference to the
Successvariant of awoah::Result. - IterMut
- An iterator over a mutable reference to the
Successvariant of awoah::Result.
Enums§
- Result
- A type representing success (
Success), a local error (LocalErr), or a fatal error (FatalErr).