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

    fn kind_of<R: ReplicateSafe<Self>>() -> Self::Kind;
    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: Replicate<Self>>(self) -> Option<R>; fn cast_ref<R: ReplicateSafe<Self>>(&self) -> Option<&R>; fn cast_mut<R: ReplicateSafe<Self>>(&mut self) -> Option<&mut R>; fn extract_and_insert<N, X: ProtocolInserter<Self, N>>(
        &self,
        entity: &N,
        inserter: &mut X
    ); 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