pub enum OwnedLocalEntity {
Host {
id: u16,
is_static: bool,
},
Remote {
id: u16,
is_static: bool,
},
}Expand description
A connection-local entity ID that records whether the entity is host-owned or remote-owned.
Variants§
Host
Entity whose authoritative state originates on this side of the connection.
Fields
Remote
Entity whose authoritative state originates on the far side of the connection.
Implementations§
Source§impl OwnedLocalEntity
impl OwnedLocalEntity
Sourcepub fn new_host(id: HostEntity) -> Self
pub fn new_host(id: HostEntity) -> Self
Creates a dynamic Host variant from a HostEntity.
Sourcepub fn new_host_dynamic(id: u16) -> Self
pub fn new_host_dynamic(id: u16) -> Self
Creates a dynamic Host variant from a raw u16 ID.
Sourcepub fn new_host_static(id: u16) -> Self
pub fn new_host_static(id: u16) -> Self
Creates a static Host variant from a raw u16 ID.
Sourcepub fn new_remote(id: RemoteEntity) -> Self
pub fn new_remote(id: RemoteEntity) -> Self
Creates a Remote variant from a RemoteEntity, preserving its is_static flag.
Sourcepub fn new_remote_dynamic(id: u16) -> Self
pub fn new_remote_dynamic(id: u16) -> Self
Creates a dynamic Remote variant from a raw u16 ID.
Sourcepub fn new_remote_static(id: u16) -> Self
pub fn new_remote_static(id: u16) -> Self
Creates a static Remote variant from a raw u16 ID.
Sourcepub fn ser(&self, writer: &mut dyn BitWrite)
pub fn ser(&self, writer: &mut dyn BitWrite)
Serializes this entity into the bit stream, writing host/remote flag, static flag, and ID.
Sourcepub fn de(reader: &mut BitReader<'_>) -> Result<Self, SerdeErr>
pub fn de(reader: &mut BitReader<'_>) -> Result<Self, SerdeErr>
Deserializes an OwnedLocalEntity from the bit stream.
Sourcepub fn bit_length(&self) -> u32
pub fn bit_length(&self) -> u32
Returns the encoded bit length of this entity.
Sourcepub fn host(&self) -> HostEntity
pub fn host(&self) -> HostEntity
Extracts the inner HostEntity, panicking if this is a Remote variant.
Sourcepub fn remote(&self) -> RemoteEntity
pub fn remote(&self) -> RemoteEntity
Extracts the inner RemoteEntity, panicking if this is a Host variant.
Trait Implementations§
Source§impl Clone for OwnedLocalEntity
impl Clone for OwnedLocalEntity
Source§fn clone(&self) -> OwnedLocalEntity
fn clone(&self) -> OwnedLocalEntity
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OwnedLocalEntity
impl Debug for OwnedLocalEntity
Source§impl Hash for OwnedLocalEntity
impl Hash for OwnedLocalEntity
Source§impl PartialEq for OwnedLocalEntity
impl PartialEq for OwnedLocalEntity
Source§fn eq(&self, other: &OwnedLocalEntity) -> bool
fn eq(&self, other: &OwnedLocalEntity) -> bool
self and other values to be equal, and is used by ==.