pub struct HostEntityGenerator { /* private fields */ }Expand description
Issues and recycles wire-level HostEntity identifiers for a single connected user.
Implementations§
Source§impl HostEntityGenerator
impl HostEntityGenerator
Sourcepub fn new(user_key: u64) -> Self
pub fn new(user_key: u64) -> Self
Creates a generator bound to user_key with fresh entity and static-entity ID pools.
Sourcepub fn host_reserve_entity(
&mut self,
entity_map: &mut LocalEntityMap,
global_entity: &GlobalEntity,
) -> HostEntity
pub fn host_reserve_entity( &mut self, entity_map: &mut LocalEntityMap, global_entity: &GlobalEntity, ) -> HostEntity
Allocates a HostEntity for global_entity before it has been sent, expiring reservations that have timed out.
Sourcepub fn host_remove_reserved_entity(
&mut self,
global_entity: &GlobalEntity,
) -> Option<HostEntity>
pub fn host_remove_reserved_entity( &mut self, global_entity: &GlobalEntity, ) -> Option<HostEntity>
Removes and returns the reserved HostEntity for global_entity, if one exists.
Sourcepub fn remove_by_remote_entity(
&mut self,
entity_map: &mut LocalEntityMap,
remote_entity: &RemoteEntity,
) -> GlobalEntity
pub fn remove_by_remote_entity( &mut self, entity_map: &mut LocalEntityMap, remote_entity: &RemoteEntity, ) -> GlobalEntity
Removes the entity identified by remote_entity from entity_map, recycles its host ID, and returns its GlobalEntity.
Sourcepub fn get_user_key(&self) -> &u64
pub fn get_user_key(&self) -> &u64
Returns the user key this generator was created for.
Auto Trait Implementations§
impl Freeze for HostEntityGenerator
impl RefUnwindSafe for HostEntityGenerator
impl Send for HostEntityGenerator
impl Sync for HostEntityGenerator
impl Unpin for HostEntityGenerator
impl UnsafeUnpin for HostEntityGenerator
impl UnwindSafe for HostEntityGenerator
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