| Crates.io | anyerror |
| lib.rs | anyerror |
| version | 0.1.13 |
| created_at | 2022-01-09 12:44:36.271054+00 |
| updated_at | 2025-01-07 04:17:05.39254+00 |
| description | A type of any error for transport |
| homepage | https://github.com/drmingdrmer/anyerror |
| repository | https://github.com/drmingdrmer/anyerror |
| max_upload_size | |
| id | 510782 |
| size | 37,179 |
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