pub struct EntityProperty { /* private fields */ }Expand description
A component field that stores an optional reference to another entity, with lifecycle tracking across host/remote/delegated states.
Implementations§
Source§impl EntityProperty
impl EntityProperty
Sourcepub fn new_for_message() -> Self
pub fn new_for_message() -> Self
Creates an EntityProperty initialized for use inside a Message (no mutator).
Sourcepub fn new_for_component(mutator_index: u8) -> Self
pub fn new_for_component(mutator_index: u8) -> Self
Creates an EntityProperty initialized for use inside a Component at the given property index.
Sourcepub fn new_read(
reader: &mut BitReader<'_>,
converter: &dyn LocalEntityAndGlobalEntityConverter,
) -> Result<Self, SerdeErr>
pub fn new_read( reader: &mut BitReader<'_>, converter: &dyn LocalEntityAndGlobalEntityConverter, ) -> Result<Self, SerdeErr>
Deserializes a new EntityProperty from the remote host’s bit stream.
Sourcepub fn read_write(
reader: &mut BitReader<'_>,
writer: &mut BitWriter,
) -> Result<(), SerdeErr>
pub fn read_write( reader: &mut BitReader<'_>, writer: &mut BitWriter, ) -> Result<(), SerdeErr>
Passes through an entity-property bit field from reader to writer without resolving entities.
Sourcepub fn read(
&mut self,
reader: &mut BitReader<'_>,
converter: &dyn LocalEntityAndGlobalEntityConverter,
) -> Result<(), SerdeErr>
pub fn read( &mut self, reader: &mut BitReader<'_>, converter: &dyn LocalEntityAndGlobalEntityConverter, ) -> Result<(), SerdeErr>
Updates this property’s inner relation from the remote host’s bit stream.
Sourcepub fn waiting_complete(
&mut self,
converter: &dyn LocalEntityAndGlobalEntityConverter,
)
pub fn waiting_complete( &mut self, converter: &dyn LocalEntityAndGlobalEntityConverter, )
Resolves a waiting entity relation now that its target entity has arrived.
Sourcepub fn remote_publish(&mut self, mutator_index: u8, mutator: &PropertyMutator)
pub fn remote_publish(&mut self, mutator_index: u8, mutator: &PropertyMutator)
Migrate Remote Property to Public version
Sourcepub fn remote_unpublish(&mut self)
pub fn remote_unpublish(&mut self)
Migrate Remote Property to Public version
Sourcepub fn enable_delegation(
&mut self,
accessor: &EntityAuthAccessor,
mutator_opt: Option<(u8, &PropertyMutator)>,
)
pub fn enable_delegation( &mut self, accessor: &EntityAuthAccessor, mutator_opt: Option<(u8, &PropertyMutator)>, )
Migrate Host/RemotePublic Property to Delegated version
Sourcepub fn disable_delegation(&mut self)
pub fn disable_delegation(&mut self)
Migrate Delegated Property to Host-Owned (Public) version
Sourcepub fn set_mutator(&mut self, mutator: &PropertyMutator)
pub fn set_mutator(&mut self, mutator: &PropertyMutator)
Sets the property mutator used to mark this field dirty on value changes.
Sourcepub fn bit_length(
&self,
converter: &mut dyn LocalEntityAndGlobalEntityConverterMut,
) -> u32
pub fn bit_length( &self, converter: &mut dyn LocalEntityAndGlobalEntityConverterMut, ) -> u32
Returns the serialized bit length of this property given converter.
Sourcepub fn write(
&self,
writer: &mut dyn BitWrite,
converter: &mut dyn LocalEntityAndGlobalEntityConverterMut,
)
pub fn write( &self, writer: &mut dyn BitWrite, converter: &mut dyn LocalEntityAndGlobalEntityConverterMut, )
Writes this property’s entity reference bits into writer.
Sourcepub fn get<E: Copy + Eq + Hash + Sync + Send>(
&self,
converter: &dyn EntityAndGlobalEntityConverter<E>,
) -> Option<E>
pub fn get<E: Copy + Eq + Hash + Sync + Send>( &self, converter: &dyn EntityAndGlobalEntityConverter<E>, ) -> Option<E>
Returns the world entity referenced by this property, translated via converter, or None.
Sourcepub fn get_inner(&self) -> Option<GlobalEntity>
pub fn get_inner(&self) -> Option<GlobalEntity>
Returns the raw GlobalEntity stored in this property, or None.
Sourcepub fn set<E: Copy + Eq + Hash + Sync + Send>(
&mut self,
converter: &dyn EntityAndGlobalEntityConverter<E>,
entity: &E,
)
pub fn set<E: Copy + Eq + Hash + Sync + Send>( &mut self, converter: &dyn EntityAndGlobalEntityConverter<E>, entity: &E, )
Sets this property to point at entity, converting it to a GlobalEntity via converter.
Sourcepub fn set_to_none(&mut self)
pub fn set_to_none(&mut self)
Clears this property so it no longer references any entity.
Sourcepub fn mirror(&mut self, other: &EntityProperty)
pub fn mirror(&mut self, other: &EntityProperty)
Copies the referenced entity from other into self, preserving self’s relation type.
Sourcepub fn waiting_remote_entity(&self) -> Option<RemoteEntity>
pub fn waiting_remote_entity(&self) -> Option<RemoteEntity>
Returns the RemoteEntity this property is still waiting to resolve, or None if already resolved.
Sourcepub fn write_local_entity(
&self,
converter: &dyn LocalEntityAndGlobalEntityConverter,
writer: &mut BitWriter,
)
pub fn write_local_entity( &self, converter: &dyn LocalEntityAndGlobalEntityConverter, writer: &mut BitWriter, )
Writes the resolved local entity value; used when splitting component updates on the receive side.
Trait Implementations§
Source§impl Clone for EntityProperty
impl Clone for EntityProperty
Source§fn clone(&self) -> EntityProperty
fn clone(&self) -> EntityProperty
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more