Modify read only data from parser
⚓ Rust 📅 2026-02-08 👤 surdeus 👁️ 8I am working on a library that uses data- tags inside SVG files to embed extra data within them or flag specific tags that need their values filled in from data within the application. I then need to hand this data back to a library that is expecting a roxmltree::Document.
My current (non-working) though process is below:
- Parse SVG with
roxmltree - Convert to owned and mutable datatype
- Modify SVG file as necessary
- Convert back to
roxmltree::Document - Hand off
roxmltree::Documenttousvgparser which then gets handed off to rendering library
My current problem is implementing From<roxmltree::Document> for mylib::Tree because all of the data within Document are private fields, and only some of them have accessor methods. Not sure if the automatically implemented Into will even work with the private fields.
I am not particularly wedded to any part of this process currently, (especially as it is not working), but I have not found an alternate way to do this.
Any suggestions are appreciated.
Link to project if folks are interested: GitHub - sww1235/connection-diagram-manager at gui-dev
2 posts - 2 participants
🏷️ Rust_feed