pub trait BehaviorStore: Debug + Send {
// Required methods
fn read(&self) -> Option<BehaviorState>;
fn write(&self, state: &BehaviorState);
}Expand description
Where a host keeps persisted behavior state.
Read once when the world starts and written after any tick a save node ran
in. A world whose host installs no store runs its behaviors and persists
nothing.
Required Methods§
Sourcefn read(&self) -> Option<BehaviorState>
fn read(&self) -> Option<BehaviorState>
The stored state, or None when nothing was stored or it could not be
read.
Sourcefn write(&self, state: &BehaviorState)
fn write(&self, state: &BehaviorState)
Store state, replacing whatever was there. Only the implementor knows
what the write was to, so reporting a failure is its job.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".