pub struct HostEntity { /* private fields */ }Expand description
A host-assigned entity ID. Carries is_static so that static and dynamic
entities from pools that both start at 0 remain distinct as hash map keys.
Implementations§
Source§impl HostEntity
impl HostEntity
Sourcepub fn new_static(id: u16) -> Self
pub fn new_static(id: u16) -> Self
Creates a static host entity with the given id.
Sourcepub fn to_remote(self) -> RemoteEntity
pub fn to_remote(self) -> RemoteEntity
Converts this host entity into the equivalent RemoteEntity with the same ID and static flag.
Sourcepub fn ser(&self, writer: &mut dyn BitWrite)
pub fn ser(&self, writer: &mut dyn BitWrite)
Serializes the entity ID into the bit stream (ID only; authority messages use dynamic entities).
Sourcepub fn de(reader: &mut BitReader<'_>) -> Result<Self, SerdeErr>
pub fn de(reader: &mut BitReader<'_>) -> Result<Self, SerdeErr>
Deserializes a dynamic host entity from the bit stream.
Sourcepub fn bit_length(&self) -> u32
pub fn bit_length(&self) -> u32
Returns the encoded bit length of this entity’s ID.
Sourcepub fn copy_to_owned(&self) -> OwnedLocalEntity
pub fn copy_to_owned(&self) -> OwnedLocalEntity
Wraps this entity as an OwnedLocalEntity::Host, preserving the is_static flag.
Sourcepub fn copy_to_owned_dynamic(&self) -> OwnedLocalEntity
pub fn copy_to_owned_dynamic(&self) -> OwnedLocalEntity
Wraps this entity as a dynamic OwnedLocalEntity::Host (forcing is_static = false).
Sourcepub fn copy_to_owned_static(&self) -> OwnedLocalEntity
pub fn copy_to_owned_static(&self) -> OwnedLocalEntity
Wraps this entity as a static OwnedLocalEntity::Host (forcing is_static = true).
Trait Implementations§
Source§impl Clone for HostEntity
impl Clone for HostEntity
Source§fn clone(&self) -> HostEntity
fn clone(&self) -> HostEntity
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HostEntity
impl Debug for HostEntity
Source§impl Hash for HostEntity
impl Hash for HostEntity
Source§impl PartialEq for HostEntity
impl PartialEq for HostEntity
Source§fn eq(&self, other: &HostEntity) -> bool
fn eq(&self, other: &HostEntity) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for HostEntity
impl Eq for HostEntity
impl StructuralPartialEq for HostEntity
Auto Trait Implementations§
impl Freeze for HostEntity
impl RefUnwindSafe for HostEntity
impl Send for HostEntity
impl Sync for HostEntity
impl Unpin for HostEntity
impl UnsafeUnpin for HostEntity
impl UnwindSafe for HostEntity
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