pub struct DirtyTracker { /* private fields */ }Expand description
Tracks dirty state for a set of replicated properties on an entity.
Implementations§
Source§impl DirtyTracker
impl DirtyTracker
pub fn new(entity_id: SyncEntityId) -> Self
pub fn entity_id(&self) -> SyncEntityId
pub fn add_property(&mut self, property: ReplicatedProperty)
pub fn update_property(&mut self, index: u32, data: Vec<u8>)
pub fn get_property(&self, index: u32) -> Option<&ReplicatedProperty>
pub fn dirty_flags(&self) -> PropertyFlags
pub fn has_dirty(&self) -> bool
pub fn force_full_update(&mut self)
Sourcepub fn collect_dirty(&self) -> Vec<(u32, Vec<u8>)>
pub fn collect_dirty(&self) -> Vec<(u32, Vec<u8>)>
Collect dirty properties for replication. Returns (property_index, data) pairs.
Sourcepub fn collect_reliable_dirty(&self) -> Vec<(u32, Vec<u8>)>
pub fn collect_reliable_dirty(&self) -> Vec<(u32, Vec<u8>)>
Collect only reliable dirty properties.
Sourcepub fn collect_unreliable_dirty(&self) -> Vec<(u32, Vec<u8>)>
pub fn collect_unreliable_dirty(&self) -> Vec<(u32, Vec<u8>)>
Collect only unreliable dirty properties.
Sourcepub fn clear_dirty(&mut self)
pub fn clear_dirty(&mut self)
Mark all dirty properties as clean after replication.
pub fn property_count(&self) -> usize
Sourcepub fn dirty_size(&self) -> usize
pub fn dirty_size(&self) -> usize
Total estimated replication size for dirty properties.
Auto Trait Implementations§
impl Freeze for DirtyTracker
impl RefUnwindSafe for DirtyTracker
impl Send for DirtyTracker
impl Sync for DirtyTracker
impl Unpin for DirtyTracker
impl UnsafeUnpin for DirtyTracker
impl UnwindSafe for DirtyTracker
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.