-
Notifications
You must be signed in to change notification settings - Fork 731
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
Value::from_serde
?
#819
Comments
Related: #824 (which also deals with adding |
In general, while this sounds pretty simple, it's a pretty big issue, since it kind of depends on two tasks:
This is definitely something I think we all want to see --- currently, An ideal solution would meet the following goals:
Some of these are more negotiable than others --- in particular, a feature-flagged Complete |
I just merged in some refactoring to I've been wanting to pull the |
Very cool. I need to take a closer look at this strategy. Haven't had time yet, but I'm definitely interested in seeing what you've done. :) |
Another possible solution for supporting
Then, we could add a This does have one significant downside: currently, all the We could hack around that limitation by making the This would also, critically, not allow us to record arbitrary |
Don't know much about the details, but perhaps erased-serde could be useful here if object safety is the issue? This would be an amazing feature. |
Feature Request
Motivation
I'd like to allow my subscriber to record arbitrarily nested objects from users' macros.
Proposal
I'd like some way to create a
Value
from theerased-serde
traits (erased to reduce binary bloat). The basic sketch proposed by @KodrAus in rust-lang/log#328 (comment) for thelog
crate seems compelling to me but I haven't worked through all of the implications fortracing
.Alternatives
The most significant assumption of this request is that
serde
-based traits should be the public API. It's possible that we would be better off extendingValue
to support nesting in a different way (and offering a polyfill for serde implementors?).It's also possible that
Value
is not the right place to include this compatibility but my naive impression is that it's probably the right call.Another potential alternative would be to reuse the
Value
type from thelog
crate's kv support or to work with them to extract that type into a lower-level shared crate. This seems like a great target to drive towards but I suspect both projects will be better served by converging on a shared type once they both have their respective use cases understood and addressed.The text was updated successfully, but these errors were encountered: