Skip to main content

load_from_str

Function load_from_str 

Source
pub fn load_from_str(json: &str) -> GameState
Expand description

Best-effort load from a JSON string. Falls back to a default state if the input is malformed at any layer of the chain. The result is always passed through GameState::migrate_runtime so ephemeral #[serde(skip)] fields (flash vecs, count-up tweens, etc.) are seeded.

Versions outside the known set deserialize as default — this is pessimistic on purpose (a future version is more likely to have new fields than the current code can interpret).