Skip to main content

GlobalDiffHandler

Struct GlobalDiffHandler 

Source
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

Source

pub fn new() -> Self

Creates an empty GlobalDiffHandler.

Source

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.

Source

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).

Source

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).

Source

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.

Source

pub fn deregister_component( &mut self, entity: &GlobalEntity, component_kind: &ComponentKind, )

Removes the mutation channel for (entity, component_kind), stopping further dirty notifications.

Source

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.

Trait Implementations§

Source§

impl Default for GlobalDiffHandler

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V