-
Notifications
You must be signed in to change notification settings - Fork 93
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
Equivalents of serde_json::from_*
#2097
Comments
Thanks for reaching out, it's interesting for us to know how much people are using Nickel to deserialize directly from Rust. I agree that the current setup is workable but really not ideal (and I really don't like this What you propose is a simple and good first step. If you wish to take a stab at implementing it, we would accept the PR 👍 |
Happy to do a PR. What's the proper way to do error handling for this function? It should return |
Indeed, nesting results isn't great. From the top of my head, I suspect we'll need a new kind of error. The error hierarchy ends up with the most general Naming is hard - so this is just a placeholder name I'm giving - but we need a new |
Is your feature request related to a problem? Please describe.
It would be nice if nickel had functions that would wrap the entire deserialization pipeline. For instance, serde_json has
from_str
,from_reader
, etc. In nickel, however, you have to create a program, manually set its source name and stderr, then eval it, and then deserialize.Describe the solution you'd like
Something like this (but without the nested
Result
; it's necessary in this example because AFAICTRustDeserializationError
isn'tInto<nickel_lang_core::error::Error>
).Describe alternatives you've considered
None
Additional context
Related: #1751
The text was updated successfully, but these errors were encountered: