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

#542 in Rust patterns

Download history 3716/week @ 2024-01-03 6314/week @ 2024-01-10 6562/week @ 2024-01-17 5484/week @ 2024-01-24 4279/week @ 2024-01-31 2867/week @ 2024-02-07 7296/week @ 2024-02-14 6920/week @ 2024-02-21 7235/week @ 2024-02-28 6338/week @ 2024-03-06 7774/week @ 2024-03-13 7282/week @ 2024-03-20 6301/week @ 2024-03-27 6007/week @ 2024-04-03 5181/week @ 2024-04-10 3217/week @ 2024-04-17

21,422 downloads per month
Used in 10 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.7MB
~39K SLoC