Skip to content

recommendations for chaining Readers and Writers #828

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

Closed
jokeyrhyme opened this issue Oct 26, 2024 · 1 comment
Closed

recommendations for chaining Readers and Writers #828

jokeyrhyme opened this issue Oct 26, 2024 · 1 comment
Labels
enhancement question serde Issues related to mapping from Rust types to XML

Comments

@jokeyrhyme
Copy link

Howdie

Firstly, thanks so much for sharing this project, it's incredibly useful <3

I have a use case where I have a series of transformations that I'd like to apply to an XML document prior to deserializing it with serde

At the moment, I'm holding the entire document in a String, feeding it into a Reader, looping over read_event(), writing the desired events out into a Writer<Cursor<Vec<u8>>>, and then pulling that out into String/str and feeding that into the next Reader, and so on

I can't help but feel that there's got to be a more pull-based approach where the serde deserializer pulls events from the final transformer, and that transformer pulls events from the transformer before it, and so on, so that I'm holding as few copies of the XML document in memory as possible

Do you have any advice or recommendations or examples for how to accomplish this?

Cheers <3

@Mingun Mingun added enhancement question serde Issues related to mapping from Rust types to XML labels Oct 27, 2024
@Mingun
Copy link
Collaborator

Mingun commented Oct 27, 2024

Currently Deserializer has no API to take a stream of events and deserialize from it. That addition would be welcome. Task in such form is a duplicate of #611, so I close it.

@Mingun Mingun closed this as not planned Won't fix, can't repro, duplicate, stale Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement question serde Issues related to mapping from Rust types to XML
Projects
None yet
Development

No branches or pull requests

2 participants