Skip to main content

EntityConverterMut

Struct EntityConverterMut 

Source
pub struct EntityConverterMut<'a, 'b> { /* private fields */ }
Expand description

Stateful converter used when writing messages: looks up or reserves host-side entity slots on demand.

Implementations§

Source§

impl<'a, 'b> EntityConverterMut<'a, 'b>

Source

pub fn new( global_world_manager: &'a dyn GlobalWorldManagerType, local_entity_map: &'b mut LocalEntityMap, host_entity_generator: &'b mut HostEntityGenerator, ) -> Self

Creates an EntityConverterMut backed by the given world manager, entity map, and generator.

Trait Implementations§

Source§

impl<'a, 'b> LocalEntityAndGlobalEntityConverter for EntityConverterMut<'a, 'b>

Source§

fn global_entity_to_host_entity( &self, global_entity: &GlobalEntity, ) -> Result<HostEntity, EntityDoesNotExistError>

Returns the HostEntity for global_entity if one is registered, or an error otherwise.
Source§

fn global_entity_to_remote_entity( &self, global_entity: &GlobalEntity, ) -> Result<RemoteEntity, EntityDoesNotExistError>

Returns the RemoteEntity for global_entity if one is registered, or an error otherwise.
Source§

fn global_entity_to_owned_entity( &self, global_entity: &GlobalEntity, ) -> Result<OwnedLocalEntity, EntityDoesNotExistError>

Returns the OwnedLocalEntity (host or remote) for global_entity, or an error if not found.
Source§

fn host_entity_to_global_entity( &self, host_entity: &HostEntity, ) -> Result<GlobalEntity, EntityDoesNotExistError>

Returns the GlobalEntity for a dynamic host_entity, or an error if not found.
Source§

fn static_host_entity_to_global_entity( &self, host_entity: &HostEntity, ) -> Result<GlobalEntity, EntityDoesNotExistError>

Returns the GlobalEntity for a static host_entity, or an error if not found.
Source§

fn remote_entity_to_global_entity( &self, remote_entity: &RemoteEntity, ) -> Result<GlobalEntity, EntityDoesNotExistError>

Returns the GlobalEntity for remote_entity, or an error if not found.
Source§

fn apply_entity_redirect(&self, entity: &OwnedLocalEntity) -> OwnedLocalEntity

Returns the current redirect target for entity, or entity unchanged if no redirect is installed.
Source§

fn owned_entity_to_global_entity( &self, owned_entity: &OwnedLocalEntity, ) -> Result<GlobalEntity, EntityDoesNotExistError>

Returns the GlobalEntity for owned_entity, dispatching to the appropriate host or remote lookup.
Source§

impl<'a, 'b> LocalEntityAndGlobalEntityConverterMut for EntityConverterMut<'a, 'b>

Source§

fn get_or_reserve_entity( &mut self, global_entity: &GlobalEntity, ) -> Result<OwnedLocalEntity, EntityDoesNotExistError>

Looks up the local entity for global_entity, reserving a new host slot if none exists yet.

Auto Trait Implementations§

§

impl<'a, 'b> Freeze for EntityConverterMut<'a, 'b>

§

impl<'a, 'b> !RefUnwindSafe for EntityConverterMut<'a, 'b>

§

impl<'a, 'b> !Send for EntityConverterMut<'a, 'b>

§

impl<'a, 'b> !Sync for EntityConverterMut<'a, 'b>

§

impl<'a, 'b> Unpin for EntityConverterMut<'a, 'b>

§

impl<'a, 'b> UnsafeUnpin for EntityConverterMut<'a, 'b>

§

impl<'a, 'b> !UnwindSafe for EntityConverterMut<'a, 'b>

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> 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, 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