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

#220 in Encoding

Download history 5432/week @ 2024-12-22 4755/week @ 2024-12-29 8183/week @ 2025-01-05 5221/week @ 2025-01-12 6220/week @ 2025-01-19 7925/week @ 2025-01-26 7207/week @ 2025-02-02 5795/week @ 2025-02-09 4933/week @ 2025-02-16 5435/week @ 2025-02-23 6210/week @ 2025-03-02 8648/week @ 2025-03-09 7471/week @ 2025-03-16 6952/week @ 2025-03-23 7128/week @ 2025-03-30 6970/week @ 2025-04-06

29,607 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
~36K SLoC