I’am just beginning with Rust, reading the book. I’m familiar with Java and C++ (Qt). Because I want a little bit more speed, I’m thinking about rewriting my program with Rust.
The program parses a script and produces images and other scripts (SVG+Python) to render more pictures.
There is a root object that holds all the data collected from the original script. Nearly all twigs and leafs get a reference to that root object to fetch information from it.
From what I have read so far, I ask me, if such a structure is possible to maintain in rust.
Example: The width of the pictures to produce is one of the informations hold by the root object. Twigs and leafs will read this information without changing it (immutable). But it is possible, that the script changes the format. If that happens, it would be early, but there will be already at least some twigs with a reference to the root object. But, as far as I understood, its not possible anymore to change the content of the root object (struct) when there are any immutable references. So I’m more than a little bit confused, if it is possible to structure my program as before.
Is there any way in Rust to build such a root object?