Skip to main content

HostWorldManager

Struct HostWorldManager 

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

Drives outbound entity-lifecycle replication for one side of a connection, tracking delivery state and processing inbound authority responses.

Implementations§

Source§

impl HostWorldManager

Source

pub fn new(host_type: HostType, user_key: u64) -> Self

Creates a HostWorldManager for the given host_type side and user_key.

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: &LocalEntityMap, world: &mut W, incoming_messages: Vec<(MessageIndex, EntityMessage<HostEntity>)>, ) -> Vec<EntityEvent>

Processes incoming_messages through the host engine and returns all resulting EntityEvents.

Source

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

Drains and returns all pending outbound EntityCommands queued by the host engine.

Source

pub fn init_static_entity_send_host_commands( &mut self, converter: &dyn LocalEntityAndGlobalEntityConverter, global_entity: &GlobalEntity, component_kinds: Vec<ComponentKind>, )

Sends the initial spawn command(s) for a static entity, coalescing components into a single message when present.

Source

pub fn init_entity_send_host_commands( &mut self, converter: &dyn LocalEntityAndGlobalEntityConverter, global_entity: &GlobalEntity, component_kinds: Vec<ComponentKind>, entity_update_manager: &mut EntityUpdateManager, component_kinds_map: &ComponentKinds, )

Registers components for diff-tracking and sends initial spawn command(s) when an entity first enters connection scope.

Source

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

Enqueues command for reliable delivery to the remote peer.

Source

pub fn on_delivered_despawn_entity( &mut self, local_entity_map: &mut LocalEntityMap, host_entity: &HostEntity, )

Handles confirmed delivery of a despawn command, recycling the host entity ID and updating metrics.

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