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

#222 in Encoding

Download history 4905/week @ 2024-12-31 8186/week @ 2025-01-07 4870/week @ 2025-01-14 7890/week @ 2025-01-21 7053/week @ 2025-01-28 6450/week @ 2025-02-04 5843/week @ 2025-02-11 5165/week @ 2025-02-18 5321/week @ 2025-02-25 7228/week @ 2025-03-04 8452/week @ 2025-03-11 6905/week @ 2025-03-18 7570/week @ 2025-03-25 6786/week @ 2025-04-01 6848/week @ 2025-04-08 6218/week @ 2025-04-15

28,499 downloads per month
Used in 24 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–6MB
~35K SLoC