pub trait CompPacket:
Clone
+ Debug
+ Send
+ 'static {
type Phantom: Clone + Debug + Serialize + DeserializeOwned;
// Required methods
fn apply_insert(self, entity: Entity, world: &World, force_update: bool);
fn apply_modify(self, entity: Entity, world: &World, force_update: bool);
fn apply_remove(phantom: Self::Phantom, entity: Entity, world: &World);
}
Expand description
Implemented by type that carries component data for insertion and
modification The assocatied Phantom
type only carries information about
which component type is of interest and is used to transmit deletion events
Required Associated Types§
Required Methods§
fn apply_insert(self, entity: Entity, world: &World, force_update: bool)
fn apply_modify(self, entity: Entity, world: &World, force_update: bool)
fn apply_remove(phantom: Self::Phantom, entity: Entity, world: &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.