Hello,
I'm currently working on a very memory restricted platform (embedded system) and need to parse XML. I cannot store the whole XML file at once in memory as it is bigger than my available RAM.
My idea was to download a part of the XML file into a buffer, parse it on the fly, only extract the information I need, and download the next part of the file.
For that I need to access the buffer that was passed to the EventReader. But currently I can't find a way to make this work with the borrow checker, as I am always trying to modify the buffer (to load the new data into it) while a shared reference is held by the EventParser. As we know, modifying data that somebody helds a shared reference to, is a big no no in Rust.
I saw the streaming.rs test in the repository but I'm not sure if I can apply it to my use case.
How can something like this be implemented with the crate?
Thank you!
Hello, I'm currently working on a very memory restricted platform (embedded system) and need to parse XML. I cannot store the whole XML file at once in memory as it is bigger than my available RAM. My idea was to download a part of the XML file into a buffer, parse it on the fly, only extract the information I need, and download the next part of the file.
For that I need to access the buffer that was passed to the EventReader. But currently I can't find a way to make this work with the borrow checker, as I am always trying to modify the buffer (to load the new data into it) while a shared reference is held by the EventParser. As we know, modifying data that somebody helds a shared reference to, is a big no no in Rust.
I saw the streaming.rs test in the repository but I'm not sure if I can apply it to my use case. How can something like this be implemented with the crate? Thank you!