pub struct GlobalDiffHandler { /* private fields */ }Expand description
Global registry of mutation channels for every (entity, component) pair, used to fan out property changes to per-user dirty queues.
Implementations§
Source§impl GlobalDiffHandler
impl GlobalDiffHandler
Sourcepub fn kind_bit(&self, component_kind: &ComponentKind) -> Option<u16>
pub fn kind_bit(&self, component_kind: &ComponentKind) -> Option<u16>
NetId of a registered kind, used as bit position in the per-user
DirtyQueue’s flat-strided bitset. Returns None if the kind
has never gone through register_component here.
Sourcepub fn kind_count(&self) -> u16
pub fn kind_count(&self) -> u16
Highest kind_bit + 1 ever registered with this handler. The
per-user DirtyQueue uses this to size its stride
(ceil(kind_count / 64) AtomicU64 words per entity).
Sourcepub fn has_component(
&self,
global_entity: &GlobalEntity,
component_kind: &ComponentKind,
) -> bool
pub fn has_component( &self, global_entity: &GlobalEntity, component_kind: &ComponentKind, ) -> bool
Returns true if a mutation channel is registered for (global_entity, component_kind).
Sourcepub fn register_component(
&mut self,
component_kinds: &ComponentKinds,
global_world_manager: &dyn GlobalWorldManagerType,
global_entity: &GlobalEntity,
component_kind: &ComponentKind,
diff_mask_length: u8,
) -> MutSender
pub fn register_component( &mut self, component_kinds: &ComponentKinds, global_world_manager: &dyn GlobalWorldManagerType, global_entity: &GlobalEntity, component_kind: &ComponentKind, diff_mask_length: u8, ) -> MutSender
Creates a MutSender/MutReceiverBuilder pair for (global_entity, component_kind) and returns the sender.
Sourcepub fn deregister_component(
&mut self,
entity: &GlobalEntity,
component_kind: &ComponentKind,
)
pub fn deregister_component( &mut self, entity: &GlobalEntity, component_kind: &ComponentKind, )
Removes the mutation channel for (entity, component_kind), stopping further dirty notifications.
Sourcepub fn receiver(
&self,
address: &Option<SocketAddr>,
entity: &GlobalEntity,
component_kind: &ComponentKind,
) -> Option<MutReceiver>
pub fn receiver( &self, address: &Option<SocketAddr>, entity: &GlobalEntity, component_kind: &ComponentKind, ) -> Option<MutReceiver>
Builds a MutReceiver for address from the builder registered for (entity, component_kind), if one exists.