-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NngFail is not compatible with failure::Error #24
Comments
Yeah, revisiting NngFail/Return/etc has been on my to-do list, think there's a few FIXMEs sprinkled around as well. Was looking at the error-chain crate, but I hadn't heard things are headed towards |
I admit I have never used |
* Numerous improvements to Result and error-handling - Rename NngResult to more canonical `Result` and get rid of NngReturn - Rename NngFail to more canonical runng::Error - TryFrom conversion for NngFail - impl std::error::Error (fix #24) - Err and Unknown enums now Errno and UnknownErrno, respectively. - Rename `NngFail::succeed_then()` to `zero_map()` - Zero is `Ok` and then it's the same as `Result::map` - Tests use fewer glob (*) imports - impl AsRef/AsMut<[u8]> for Alloc and NngMsg (#25) - https://rust-lang-nursery.github.io/api-guidelines/interoperability.html#conversions-use-the-standard-traits-from-asref-asmut-c-conv-traits
It would be nice to be able to use the
?
operator in functions that can also throw other errors thanNngFail
. The most recent work on making error handling smoother in rust is thefailure
crate. It would be nice to provide compatibility with that. It can be done by derivingfailure::Fail
for your error, or if you don't want the extra dependency, implementingstd::error::Error
as described here in the docs.If you're low on time I could make a pull request for this one, but you'd have to decide whether you prefer std::error or failure.
btw off topic: I am trying to see how I will use runng and actix in my project, so I made a small test repository where I try different ways to get it to work. It might at some point serve as example code for runng. Currently it's not very documented, but just wanted to let you know it exists. Every commit is a different working example. It will definitely evolve over the next few days, because it's not at all satisfying right now. Next I will look into the async api and improve the way I invoke actix.
The text was updated successfully, but these errors were encountered: