-
Notifications
You must be signed in to change notification settings - Fork 238
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
Serde support for serializing and deserializing binary blobs in XML files #788
base: master
Are you sure you want to change the base?
Conversation
Added reading the config to determine trimming options.
src/de/mod.rs
Outdated
match e | ||
.unescape_with(|entity| self.entity_resolver.resolve(entity)) | ||
.map(|res| self.drain_text(res)) | ||
{ | ||
Ok(x) => x, | ||
// failed to escape treat as binary blob. | ||
Err(_) => Ok(DeEvent::Binary(Binary { | ||
text: e.into_inner(), | ||
})), | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We definitely shouldn't rely on luck here. Binary should be explicitly requested for the field via flag in field name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the best way/mechanism to maintain context in the code to keep track of flags like that?
This is another attempt to support binary blobs in serde, needed for vtkio.
This attempts to address #623
While initial support was added #783 this adds it for the serde api.
This PR also adjusts how trimming is handled in the serde API since this is important when dealing with binary. I tried to be consistent with the event based Reader/Writer APIs.
Please inspect the test failures to evaluate if this makes sense.