Take ownership of roxmltree::Document
⚓ Rust 📅 2026-01-09 👤 surdeus 👁️ 4roxmltree::Document is currently defined as roxmltree::Document<'input> as it does not take ownership of the &str it contains.
I am attempting to embed a Document within an existing struct that does not have lifetime parameters on it. Adding the lifetime parameters isn't the end of the world, except that this requirement cascades throughout nearly every struct in my application.
Is there some way to take ownership of the Document in this case?
The &str that it will contain is parsed from a file read in during serialization.
This is my first time really running into lifetime issues while writing rust, and I am a bit frustrated.
Thanks in advance!
2 posts - 2 participants
🏷️ Rust_feed