Skip to main content

MutReceiver

Struct MutReceiver 

Source
pub struct MutReceiver { /* private fields */ }
Expand description

Per-user receiver that accumulates dirty bits for a single component and notifies the user’s [DirtySet] on first mutation.

Implementations§

Source§

impl MutReceiver

Source

pub fn new(diff_mask_length: u8) -> Self

Creates a MutReceiver with an atomic diff mask of diff_mask_length bytes.

Source

pub fn attach_notifier(&self, notifier: DirtyNotifier)

Installed once per receiver by UserDiffHandler::register_component. Cheap no-op on re-attachment (OnceLock::set returns Err, ignored).

Source

pub fn mask_snapshot(&self) -> DiffMask

Snapshot the receiver’s current mask into an owned DiffMask. Used by world_writer when copying the mask into sent_updates before clearing the receiver. Replaces the prior RwLockReadGuard<'_, DiffMask> API which forced callers to clone while holding a read lock.

Source

pub fn mask_byte(&self, index: usize) -> u8

Read one byte of the receiver’s mask. Cheaper than mask_snapshot() when callers only need a single byte (currently unused but kept as the obvious primitive on top of the atomic representation).

Source

pub fn diff_mask_is_clear(&self) -> bool

Returns true if no property bits are currently set in this receiver’s diff mask.

Source

pub fn mutate(&self, property_index: u8)

Marks property_index dirty in the diff mask, notifying the dirty queue if the mask transitions from clean to dirty.

Source

pub fn or_mask(&self, other_mask: &DiffMask)

ORs other_mask into the diff mask, notifying the dirty queue if the mask transitions from clean to dirty.

Source

pub fn clear_mask(&self)

Clears all bits in the diff mask and notifies the dirty queue if the mask was dirty.

Trait Implementations§

Source§

impl Clone for MutReceiver

Source§

fn clone(&self) -> MutReceiver

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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