Skip to main content

RemoteWorldManager

Struct RemoteWorldManager 

Source
pub struct RemoteWorldManager { /* private fields */ }
Expand description

Manages the inbound side of entity replication — entities whose authoritative state comes from the remote peer.

Implementations§

Source§

impl RemoteWorldManager

Source

pub fn new(host_type: HostType) -> Self

Creates a RemoteWorldManager for the given host_type side of a connection.

Source

pub fn entity_waitlist(&self) -> &RemoteEntityWaitlist

Returns a shared reference to the entity waitlist.

Source

pub fn entity_waitlist_mut(&mut self) -> &mut RemoteEntityWaitlist

Returns a mutable reference to the entity waitlist.

Source

pub fn take_outgoing_commands(&mut self) -> Vec<EntityCommand>

Drains and returns all pending outbound EntityCommands from the remote engine.

Source

pub fn send_entity_command( &mut self, converter: &dyn LocalEntityAndGlobalEntityConverter, command: EntityCommand, )

Enqueues command for the entity identified in command via the remote engine, silently skipping if the entity no longer exists.

Source

pub fn spawn_entity(&mut self, entity: &RemoteEntity)

Notifies the waitlist that entity has been spawned, unblocking any queued operations.

Source

pub fn despawn_entity( &mut self, _local_entity_map: &mut LocalEntityMap, entity: &RemoteEntity, )

Removes entity from the waitlist tracking structures.

Source

pub fn take_incoming_events<E: Copy + Eq + Hash + Send + Sync, W: WorldMutType<E>>( &mut self, spawner: &mut dyn GlobalEntitySpawner<E>, global_world_manager: &dyn GlobalWorldManagerType, local_entity_map: &mut LocalEntityMap, component_kinds: &ComponentKinds, world: &mut W, now: &Instant, incoming_components: &mut HashMap<(OwnedLocalEntity, ComponentKind), Box<dyn Replicate>>, incoming_updates: Vec<(Tick, OwnedLocalEntity, ComponentUpdate)>, incoming_messages: Vec<(MessageIndex, EntityMessage<RemoteEntity>)>, ) -> Vec<EntityEvent>

Processes all buffered incoming messages and updates, applying them to world and returning the resulting EntityEvents.

Source

pub fn get_entity_auth_status( &self, entity: &RemoteEntity, ) -> Option<EntityAuthStatus>

Returns the current authority status for entity’s remote channel, if one exists.

Trait Implementations§

Source§

impl InScopeEntities<RemoteEntity> for RemoteWorldManager

Source§

fn has_entity(&self, entity: &RemoteEntity) -> bool

Returns true if entity is currently tracked as in-scope.

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