pub trait Protocolize: 'static + Clone + Sync + Send {
    type Kind: ProtocolKindType;

    fn kind_of<R>() -> Self::Kind
    where
        R: ReplicateSafe<Self>
; fn type_to_kind(type_id: TypeId) -> Option<Self::Kind>; fn read(
        bit_reader: &mut BitReader<'_>,
        converter: &dyn NetEntityHandleConverter
    ) -> Self; fn read_create_update(
        bit_reader: &mut BitReader<'_>
    ) -> ComponentUpdate<Self::Kind>; fn dyn_ref(&self) -> ReplicaDynRef<'_, Self>; fn dyn_mut(&mut self) -> ReplicaDynMut<'_, Self>; fn cast<R>(self) -> Option<R>
    where
        R: Replicate<Self>
; fn cast_ref<R>(&self) -> Option<&R>
    where
        R: ReplicateSafe<Self>
; fn cast_mut<R>(&mut self) -> Option<&mut R>
    where
        R: ReplicateSafe<Self>
; fn extract_and_insert<N, X>(&self, entity: &N, inserter: &mut X)
    where
        X: ProtocolInserter<Self, N>
; fn write(
        &self,
        bit_writer: &mut dyn BitWrite,
        converter: &dyn NetEntityHandleConverter
    ); fn write_update(
        &self,
        diff_mask: &DiffMask,
        bit_writer: &mut dyn BitWrite,
        converter: &dyn NetEntityHandleConverter
    ); }
Expand description

An Enum with a variant for every Component/Message that can be sent between Client/Host

Required Associated Types

Required Methods

Get kind of Replicate type

Get kind from a type_id

Read from a bit stream to create a new Replica

Read from a bit stream to create a new Component Update

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

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

Cast to a Replicate impl

Cast to a typed immutable reference to the inner Component/Message

Cast to a typed mutable reference to the inner Component/Message

Extract an inner Replicate impl from the Protocolize into a ProtocolInserter impl

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