Trait veloren_common_net::sync::NetSync
source · 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.
Object Safety§
This trait is not object safe.