Crate anyhow

githubcrates-iodocs-rs


This library provides [anyhow::Error][Error], a trait object based error type for easy idiomatic error handling in Rust applications.


Details


No-std support

In no_std mode, almost all of the same API is available and works the same way. To depend on Anyhow in no_std mode, disable our default enabled "std" feature in Cargo.toml. A global allocator is required.

[dependencies]
anyhow = { version = "1.0", default-features = false }

With versions of Rust older than 1.81, no_std mode may require an additional .map_err(Error::msg) when working with a non-Anyhow error type inside a function that returns Anyhow's error type, as the trait that ?-based error conversions are defined by is only available in std in those old versions.

Structs

Traits

Functions

Type Aliases

Macros