anyerror

A type of any error for transport

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

#454 in Algorithms

Download history 5871/week @ 2024-06-26 7242/week @ 2024-07-03 6503/week @ 2024-07-10 6568/week @ 2024-07-17 6886/week @ 2024-07-24 6851/week @ 2024-07-31 4356/week @ 2024-08-07 4428/week @ 2024-08-14 3911/week @ 2024-08-21 4250/week @ 2024-08-28 4490/week @ 2024-09-04 4205/week @ 2024-09-11 4144/week @ 2024-09-18 4849/week @ 2024-09-25 4573/week @ 2024-10-02 5495/week @ 2024-10-09

19,456 downloads per month
Used in 14 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.3–6MB
~37K SLoC