pub trait Prefab: 'static {
type Marker: Component + Default;
// Required method
fn spawn(self, target: Entity, world: &mut World);
// Provided method
fn extract(builder: SnapshotBuilder<'_>) -> SnapshotBuilder<'_> { ... }
}
Expand description
Abstract spawning for entity types
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn extract(builder: SnapshotBuilder<'_>) -> SnapshotBuilder<'_>
fn extract(builder: SnapshotBuilder<'_>) -> SnapshotBuilder<'_>
Extract the prefab entities from the World
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.