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 8380/week @ 2024-03-14 6411/week @ 2024-03-21 6186/week @ 2024-03-28 5971/week @ 2024-04-04 5146/week @ 2024-04-11 4351/week @ 2024-04-18 5415/week @ 2024-04-25 5864/week @ 2024-05-02 6103/week @ 2024-05-09 4832/week @ 2024-05-16 5225/week @ 2024-05-23 4876/week @ 2024-05-30 4903/week @ 2024-06-06 4365/week @ 2024-06-13 5042/week @ 2024-06-20 5035/week @ 2024-06-27

20,401 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.7MB
~38K SLoC