13 releases

0.1.12 Nov 11, 2023
0.1.10 Oct 18, 2023
0.1.9 Jul 27, 2023
0.1.8 Mar 26, 2023
0.1.6 Mar 12, 2022

#221 in Rust patterns

Download history 5472/week @ 2024-01-21 4964/week @ 2024-01-28 3433/week @ 2024-02-04 4778/week @ 2024-02-11 8274/week @ 2024-02-18 6071/week @ 2024-02-25 6750/week @ 2024-03-03 7208/week @ 2024-03-10 8180/week @ 2024-03-17 6588/week @ 2024-03-24 4373/week @ 2024-03-31 7008/week @ 2024-04-07 4624/week @ 2024-04-14 5240/week @ 2024-04-21 4545/week @ 2024-04-28 6137/week @ 2024-05-05

21,059 downloads per month
Used in 12 crates (3 directly)

Apache-2.0

20KB
442 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.4–1.8MB
~39K SLoC