Module prelude

Source
Expand description

Traits and macros used by most projects. Add use snafu::prelude::* to your code to quickly get started with SNAFU.

Re-exports§

pub use crate::OptionExt as _;
pub use crate::ResultExt as _;
pub use crate::futures::TryFutureExt as _;
pub use crate::futures::TryStreamExt as _;

Macros§

ensure
Ensure a condition is true. If it is not, return from the function with an error.
ensure_whatever
Ensure a condition is true. If it is not, return a stringly-typed error message.
whatever
Instantiate and return a stringly-typed error message.

Derive Macros§

Snafu
The Snafu macro is the entrypoint to defining your own error types. It is designed to require little configuration for the recommended and typical usecases while still offering flexibility for unique situations.