utils-results
The easiest and most intuitive error handling solution. (no dependencies, about 150 lines pure codes)
| Docs |
Overview
First, You should make your own an error set.
err!
And just errbang!
errbang!
More Examples
errbang!;
errbang!;
errbang!;
Idiomatic way to handle io::Error
io_err!
Declare matching macro and just handle that!
io_to_err!?;
err_to_io!?;
- Please use our Master Result<T> and ResultSend<T> instead std::result::Result or io::Result etc..
utils-results/lib.rs
/// Master Result
pub type Result<T> = Result;
/// Master Result for Send + Sync trait
pub type ResultSend<T> = Result;
just put this in your project.
pub use *;
You can convert any type of Result.
// to our Master Result
resultcast!?;
// also can convert master Result to ResultSend
resultcastsend!?;