pub trait Replicate: ReplicateInner + Named + Any {
Show 22 methods // Required methods fn kind(&self) -> ComponentKind; fn to_any(&self) -> &dyn Any; fn to_any_mut(&mut self) -> &mut dyn Any; fn to_boxed_any(self: Box<Self>) -> Box<dyn Any>; fn copy_to_box(&self) -> Box<dyn Replicate>; fn create_builder() -> Box<dyn ReplicateBuilder> where Self: Sized; fn diff_mask_size(&self) -> u8; fn dyn_ref(&self) -> ReplicaDynRef<'_>; fn dyn_mut(&mut self) -> ReplicaDynMut<'_>; fn mirror(&mut self, other: &dyn Replicate); fn set_mutator(&mut self, mutator: &PropertyMutator); fn write( &self, component_kinds: &ComponentKinds, writer: &mut dyn BitWrite, converter: &mut dyn LocalEntityAndGlobalEntityConverterMut ); fn write_update( &self, diff_mask: &DiffMask, writer: &mut dyn BitWrite, converter: &mut dyn LocalEntityAndGlobalEntityConverterMut ); fn read_apply_update( &mut self, converter: &dyn LocalEntityAndGlobalEntityConverter, update: ComponentUpdate ) -> Result<(), SerdeErr>; fn read_apply_field_update( &mut self, converter: &dyn LocalEntityAndGlobalEntityConverter, update: ComponentFieldUpdate ) -> Result<(), SerdeErr>; fn relations_waiting(&self) -> Option<HashSet<RemoteEntity>>; fn relations_complete( &mut self, converter: &dyn LocalEntityAndGlobalEntityConverter ); fn publish(&mut self, mutator: &PropertyMutator); fn unpublish(&mut self); fn enable_delegation( &mut self, accessor: &EntityAuthAccessor, mutator_opt: Option<&PropertyMutator> ); fn disable_delegation(&mut self); fn localize(&mut self);
}
Expand description

A struct that implements Replicate is a Component, or otherwise, a container of Properties that can be scoped, tracked, and synced, with a remote host

Required Methods§

source

fn kind(&self) -> ComponentKind

Gets the ComponentKind of this type

source

fn to_any(&self) -> &dyn Any

source

fn to_any_mut(&mut self) -> &mut dyn Any

source

fn to_boxed_any(self: Box<Self>) -> Box<dyn Any>

source

fn copy_to_box(&self) -> Box<dyn Replicate>

source

fn create_builder() -> Box<dyn ReplicateBuilder>
where Self: Sized,

source

fn diff_mask_size(&self) -> u8

Gets the number of bytes of the Component’s DiffMask

source

fn dyn_ref(&self) -> ReplicaDynRef<'_>

Get an immutable reference to the inner Component as a Replicate trait object

source

fn dyn_mut(&mut self) -> ReplicaDynMut<'_>

Get an mutable reference to the inner Component as a Replicate trait object

source

fn mirror(&mut self, other: &dyn Replicate)

Sets the current Component to the state of another Component of the same type

source

fn set_mutator(&mut self, mutator: &PropertyMutator)

Set the Component’s PropertyMutator, which keeps track of which Properties have been mutated, necessary to sync only the Properties that have changed with the client

source

fn write( &self, component_kinds: &ComponentKinds, writer: &mut dyn BitWrite, converter: &mut dyn LocalEntityAndGlobalEntityConverterMut )

Writes data into an outgoing byte stream, sufficient to completely recreate the Component on the client

source

fn write_update( &self, diff_mask: &DiffMask, writer: &mut dyn BitWrite, converter: &mut dyn LocalEntityAndGlobalEntityConverterMut )

Write data into an outgoing byte stream, sufficient only to update the mutated Properties of the Component on the client

source

fn read_apply_update( &mut self, converter: &dyn LocalEntityAndGlobalEntityConverter, update: ComponentUpdate ) -> Result<(), SerdeErr>

Reads data from an incoming packet, sufficient to sync the in-memory Component with it’s replica on the Server

source

fn read_apply_field_update( &mut self, converter: &dyn LocalEntityAndGlobalEntityConverter, update: ComponentFieldUpdate ) -> Result<(), SerdeErr>

source

fn relations_waiting(&self) -> Option<HashSet<RemoteEntity>>

Returns a list of LocalEntities contained within the Component’s EntityProperty fields, which are waiting to be converted to GlobalEntities

source

fn relations_complete( &mut self, converter: &dyn LocalEntityAndGlobalEntityConverter )

Converts any LocalEntities contained within the Component’s EntityProperty fields to GlobalEntities

source

fn publish(&mut self, mutator: &PropertyMutator)

Publish Replicate

source

fn unpublish(&mut self)

Unpublish Replicate

source

fn enable_delegation( &mut self, accessor: &EntityAuthAccessor, mutator_opt: Option<&PropertyMutator> )

Enable Delegation Replicate

source

fn disable_delegation(&mut self)

Disable Delegation Replicate

source

fn localize(&mut self)

Convert to Local Replicate

Implementors§