pub trait VariableStorage {
// Required methods
fn get(&self, name: &str) -> Option<Value>;
fn set(&mut self, name: &str, value: Value);
}Expand description
Pluggable variable storage consumed by the runner.
Implement this trait to back variables with your game’s own data model (e.g. an ECS component, a database row, or a save-file entry).
§Example
use bubbles::{HashMapStorage, Value, VariableStorage};
let mut s = HashMapStorage::new();
s.set("$score", Value::Number(10.0));
assert_eq!(s.get("$score"), Some(Value::Number(10.0)));
assert_eq!(s.get("$missing"), None);