PacketFactory

Trait PacketFactory 

Source
pub trait PacketFactory {
    type Packet: PacketCodec + PacketValidation + CompressionControl + EncryptionControl;

    // Required methods
    fn create_packet(&self, id: i32) -> Self::Packet;
    fn create_from_bytes(&self, bytes: BytesMut) -> Result<Self::Packet>;
}

Required Associated Types§

Source

type Packet: PacketCodec + PacketValidation + CompressionControl + EncryptionControl

The packet type this factory creates

Required Methods§

Source

fn create_packet(&self, id: i32) -> Self::Packet

Source

fn create_from_bytes(&self, bytes: BytesMut) -> Result<Self::Packet>

Implementors§