Skip to main content

OwnedLocalEntity

Enum OwnedLocalEntity 

Source
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

§id: u16

Wire-level entity ID within the host pool.

§is_static: bool

true if this entity belongs to the static pool.

§

Remote

Entity whose authoritative state originates on the far side of the connection.

Fields

§id: u16

Wire-level entity ID within the remote pool.

§is_static: bool

true if this entity belongs to the static pool.

Implementations§

Source§

impl OwnedLocalEntity

Source

pub fn new_host(id: HostEntity) -> Self

Creates a dynamic Host variant from a HostEntity.

Source

pub fn new_host_dynamic(id: u16) -> Self

Creates a dynamic Host variant from a raw u16 ID.

Source

pub fn new_host_static(id: u16) -> Self

Creates a static Host variant from a raw u16 ID.

Source

pub fn new_remote(id: RemoteEntity) -> Self

Creates a Remote variant from a RemoteEntity, preserving its is_static flag.

Source

pub fn new_remote_dynamic(id: u16) -> Self

Creates a dynamic Remote variant from a raw u16 ID.

Source

pub fn new_remote_static(id: u16) -> Self

Creates a static Remote variant from a raw u16 ID.

Source

pub fn is_host(&self) -> bool

Returns true if this is a Host variant.

Source

pub fn is_remote(&self) -> bool

Returns true if this is a Remote variant.

Source

pub fn is_static(&self) -> bool

Returns true if this entity belongs to the static pool.

Source

pub fn id(&self) -> u16

Returns the raw u16 wire ID for this entity, regardless of variant.

Source

pub fn ser(&self, writer: &mut dyn BitWrite)

Serializes this entity into the bit stream, writing host/remote flag, static flag, and ID.

Source

pub fn de(reader: &mut BitReader<'_>) -> Result<Self, SerdeErr>

Deserializes an OwnedLocalEntity from the bit stream.

Source

pub fn bit_length(&self) -> u32

Returns the encoded bit length of this entity.

Source

pub fn host(&self) -> HostEntity

Extracts the inner HostEntity, panicking if this is a Remote variant.

Source

pub fn remote(&self) -> RemoteEntity

Extracts the inner RemoteEntity, panicking if this is a Host variant.

Trait Implementations§

Source§

impl Clone for OwnedLocalEntity

Source§

fn clone(&self) -> OwnedLocalEntity

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
Source§

impl Debug for OwnedLocalEntity

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for OwnedLocalEntity

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for OwnedLocalEntity

Source§

fn eq(&self, other: &OwnedLocalEntity) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for OwnedLocalEntity

Source§

impl Eq for OwnedLocalEntity

Source§

impl StructuralPartialEq for OwnedLocalEntity

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