-
Notifications
You must be signed in to change notification settings - Fork 2
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
Allow deserializing from disk #1
Comments
I started taking a look at this, and it seems like the pain has to do with using // This fails to compile.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Manifest<'s, 'i, 'r> {
// ... elided
#[serde(borrow)]
icons: Vec<&'i Icon<'i>>,
#[serde(borrow)]
related_applications: Vec<&'r Related<'r>>,
} // This compiles fine.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Manifest<'s, 'i, 'r> {
// ... elided
#[serde(borrow)]
icons: Vec<Icon<'i>>,
#[serde(borrow)]
related_applications: Vec<Related<'r>>,
} So far I have yet to find anything in the Serde docs about deserializing references |
According to this comment:
It does list a (rather ugly) workaround that we could try. Thoughts @yoshuawuyts? |
@maxdeviant ugh, yeah, it probably needs to be owned then. Shame :( |
Feature Request
Summary
Enable the
Deserialize
trait.Motivation
This allows files to be read from disk and parsed using this crate.
Guide-level explanation
Explain the proposal as if it was already included in the project and you
were teaching it to another programmer. That generally means:
migration guidance.
Drawbacks
None
Rationale and alternatives
This makes this crate useful for both serializing and deserializing.
Unresolved Questions
Right now there's some lifetime problems that need to be figured out when implementing this.
The text was updated successfully, but these errors were encountered: