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

#233 in Rust patterns

Download history 4701/week @ 2023-12-06 4765/week @ 2023-12-13 3650/week @ 2023-12-20 2909/week @ 2023-12-27 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 6523/week @ 2024-03-20

29,123 downloads per month
Used in 8 crates (2 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.5–1.8MB
~40K SLoC