I'm writing a Rust starter package for other programmers to interface with a game (write bots for it), and I'm not quite sure how to accomplish a specific task.
At the beginning of initialization, each bot is sent some information that persists throughout the entire game. A different set of information is then sent every frame of the game. When I return the game state every frame, I'd like to reset the values given during initialization; that way, if a user edits the values they were sent during initialization they won't persist
For consistency with the starter packages for other languages, the values sent during initialization are encapsulated in an object with the values sent every frame. I think they do belong in the same object, as they're really different aspects of the same thing, but if necessary I'm willing to change that.
I'd like to keep the starter package API as clean as possible (and consistent with the other language starter packages) and not add any functions beyond getInit, sendInit, getFrame, and sendFrame.
In the other starter packages, I simply cache the values sent during initialization in a private global variable, but the only way I can see how to do that in Rust would be to use global mutables, which also seem to be against the Rust philosophy.
How would an experienced Rustacean do this?