pub trait Pipeline {
type Backend: for<'a> Backend<Self::Key<'a>> + Resource + Default;
type Format: Format;
type Key<'a>;
// Required methods
fn key(&self) -> Self::Key<'_>;
fn capture(&self, builder: SnapshotBuilder<'_>) -> Snapshot;
fn apply(&self, world: &mut World, snapshot: &Snapshot) -> Result<(), Error>;
// Provided method
fn build(app: &mut App) { ... }
}
Expand description
Trait that defines how exactly your app saves and loads.
Required Associated Types§
Required Methods§
Sourcefn capture(&self, builder: SnapshotBuilder<'_>) -> Snapshot
fn capture(&self, builder: SnapshotBuilder<'_>) -> Snapshot
Retrieve a Snapshot
from the World
.
This is where you would do any special filtering you might need.
You must extract Checkpoints
if you want this pipeline to handle checkpoints properly.
Provided Methods§
Sourcefn build(app: &mut App)
fn build(app: &mut App)
Called when the pipeline is initialized with App::init_pipeline
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.