pub trait NetSync:
Component
+ Clone
+ Send
+ Syncwhere
Self::Storage: Tracked,{
const SYNC_FROM: SyncFrom;
// Provided methods
fn pre_insert(&mut self, world: &World) { ... }
fn pre_modify(&mut self, world: &World) { ... }
}
Expand description
Trait that must be implemented for most components that are synced over the network.
Required Associated Constants§
Sourceconst SYNC_FROM: SyncFrom
const SYNC_FROM: SyncFrom
Determines what for entities this component is synced to the client.
For example, SyncFrom::ClientEntity
can be used to only sync the
components for the client’s own entity.
Provided Methods§
Sourcefn pre_insert(&mut self, world: &World)
fn pre_insert(&mut self, world: &World)
Allows making modifications before the synced component is inserted on the client.
Sourcefn pre_modify(&mut self, world: &World)
fn pre_modify(&mut self, world: &World)
Allows making modifications before the synced component is overwritten with this version on the client.
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.