pub type OnSaveCallback = Box<dyn Fn(&RunState) + Send + Sync>;
Callback fired when the engine wants to persist its state (at safe boundaries and run end).
pub struct OnSaveCallback(/* private fields */);