struct TrackedEntity {
entity: WeakEntity,
server_entity: SyncMutex<ServerEntityMovementSyncState>,
last_passenger_ids: SyncMutex<Vec<i32>>,
last_leash_holder_id: SyncMutex<Option<i32>>,
tracking_range: EntityTrackingRange,
registered_chunk: ChunkPos,
seen_by: SyncRwLock<FxHashSet<i32>>,
}Expand description
Tracking data for a single entity.
Fields§
§entity: WeakEntityWeak reference to the entity. When this fails to upgrade, entity is dead.
server_entity: SyncMutex<ServerEntityMovementSyncState>Vanilla ServerEntity movement sync state owned by the tracker.
last_passenger_ids: SyncMutex<Vec<i32>>Last direct passenger ids sent to tracking clients.
last_leash_holder_id: SyncMutex<Option<i32>>Last leash holder id sent to tracking clients.
tracking_range: EntityTrackingRangeVanilla client tracking range converted to blocks.
registered_chunk: ChunkPosCurrent chunk used by the player-view predicate.
seen_by: SyncRwLock<FxHashSet<i32>>Players currently tracking this entity (interior mutable for concurrent access).
Auto Trait Implementations§
impl !Freeze for TrackedEntity
impl !RefUnwindSafe for TrackedEntity
impl !UnwindSafe for TrackedEntity
impl Send for TrackedEntity
impl Sync for TrackedEntity
impl Unpin for TrackedEntity
impl UnsafeUnpin for TrackedEntity
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreWraps this value in an
Arc<SyncMutex<>>