pub trait ReplicateSafe<P: ProtocolType>: ReplicateInner {
    fn get_kind(&self) -> P::Kind;
fn get_diff_mask_size(&self) -> u8;
fn dyn_ref(&self) -> ReplicaDynRef<'_, P>;
fn dyn_mut(&mut self) -> ReplicaDynMut<'_, P>;
fn into_protocol(self) -> P;
fn protocol_copy(&self) -> P;
fn mirror(&mut self, other: &P);
fn set_mutator(&mut self, mutator: &PropertyMutator);
fn read_partial(
        &mut self,
        diff_mask: &DiffMask,
        reader: &mut PacketReader<'_>,
        packet_index: u16
    );
fn write(&self, out_bytes: &mut Vec<u8>);
fn write_partial(&self, diff_mask: &DiffMask, out_bytes: &mut Vec<u8>); }
Expand description

The part of ReplicateSafe which is object-safe

Required methods

Gets the TypeId of the Message/Component, used to map to a registered ProtocolType

Gets the number of bytes of the Message/Component’s DiffMask

Get an immutable reference to the inner Component/Message as a ReplicateSafe trait object

Get an mutable reference to the inner Component/Message as a ReplicateSafe trait object

Returns self as a Protocol

Returns a copy of self as a Protocol

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

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

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

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

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

Implementors