14 releases

0.1.13 Jan 7, 2025
0.1.12 Nov 11, 2023
0.1.10 Oct 18, 2023
0.1.9 Jul 27, 2023
0.1.6 Mar 12, 2022

#232 in Rust patterns

Download history 8878/week @ 2025-10-21 6755/week @ 2025-10-28 6356/week @ 2025-11-04 5700/week @ 2025-11-11 49119/week @ 2025-11-18 53278/week @ 2025-11-25 26104/week @ 2025-12-02 24352/week @ 2025-12-09 24051/week @ 2025-12-16 11290/week @ 2025-12-23 15605/week @ 2025-12-30 32695/week @ 2026-01-06 18024/week @ 2026-01-13 10513/week @ 2026-01-20 17384/week @ 2026-01-27 21436/week @ 2026-02-03

71,962 downloads per month
Used in 44 crates (7 directly)

Apache-2.0

21KB
460 lines

AnyError

AnyError is a serializable casing for Error.

AnyError can be employed to transform other Error types into a serializable Error for transmission, preserving most of the essential information.

let err = fmt::Error {};
let e = AnyError::new(&err)
            .add_context(|| "running test")
            .add_context(|| "developing new feature");
println!("{:#}", e);

The above code will print error description with context:

core::fmt::Error: an error occurred when formatting an argument
    while: running test
    while: developing new feature

Dependencies

~0.3–1.8MB
~40K SLoC