-
-
Notifications
You must be signed in to change notification settings - Fork 793
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
impl Serialize for OnceCell #1952
Comments
See also serde-rs#812 for other unstable functionality in serde. Fixes serde-rs#1952
I see the PR was closed due to lack of real-world use cases, so I wanted share how I would use it. I'm currently working on a DSL where I first produce an AST, I then do some validation, as well as adding type information to each node in the AST. Adding the type information only happens once, but it requires that the full AST exists first. To me, The reason I need the AST to be serializable is so I can use it for code generation from different languages like typescript etc. later on. I understand that this probably won't make you reconsider. I'm also evaluating alternatives to the way I'm currently doing things, but having support for OnceCell would make things a bit simpler. Edit: The same goes for |
fwiw, I am haphazardly maintaining https://crates.io/crates/once_cell_serde |
Like
RefCell
, it is useful ifOnceCell
can be serialized with serde.The text was updated successfully, but these errors were encountered: