Skip to main content

EntityEvent

Enum EntityEvent 

Source
pub enum EntityEvent {
Show 14 variants Spawn(GlobalEntity), Despawn(GlobalEntity), InsertComponent(GlobalEntity, ComponentKind), RemoveComponent(GlobalEntity, Box<dyn Replicate>), UpdateComponent(Tick, GlobalEntity, ComponentKind), Publish(GlobalEntity), Unpublish(GlobalEntity), EnableDelegation(GlobalEntity), DisableDelegation(GlobalEntity), SetAuthority(GlobalEntity, EntityAuthStatus), RequestAuthority(GlobalEntity), ReleaseAuthority(GlobalEntity), EnableDelegationResponse(GlobalEntity), MigrateResponse(GlobalEntity, RemoteEntity),
}
Expand description

ECS-level event produced by the replication system when the remote world state changes.

Variants§

§

Spawn(GlobalEntity)

A new entity was spawned by the remote.

§

Despawn(GlobalEntity)

An existing entity was despawned by the remote.

§

InsertComponent(GlobalEntity, ComponentKind)

A component was added to an entity.

§

RemoveComponent(GlobalEntity, Box<dyn Replicate>)

A component was removed from an entity; carries the last known component value.

§

UpdateComponent(Tick, GlobalEntity, ComponentKind)

A component on an entity was updated at the given tick.

§

Publish(GlobalEntity)

Entity was published (made visible to other users).

§

Unpublish(GlobalEntity)

Entity publication was retracted.

§

EnableDelegation(GlobalEntity)

Authority delegation was enabled for an entity.

§

DisableDelegation(GlobalEntity)

Authority delegation was disabled for an entity.

§

SetAuthority(GlobalEntity, EntityAuthStatus)

Authority status for a delegated entity was updated.

§

RequestAuthority(GlobalEntity)

Client is requesting authority over an entity.

§

ReleaseAuthority(GlobalEntity)

Client is releasing authority over an entity.

§

EnableDelegationResponse(GlobalEntity)

Client acknowledged that delegation is now enabled.

§

MigrateResponse(GlobalEntity, RemoteEntity)

An entity migrated; carries the new remote entity ID.

Implementations§

Source§

impl EntityEvent

Source

pub fn to_type(&self) -> Option<EntityMessageType>

Returns the EntityMessageType discriminant for this event, or None for UpdateComponent (which has no wire type).

Source

pub fn entity(&self) -> GlobalEntity

Returns the GlobalEntity this event refers to.

Source

pub fn log(&self) -> String

Returns a human-readable string describing this event, suitable for debug logging.

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