Trait Packet

Source
pub trait Packet {
    const ID: u16;
    const NAME: &'static str;
    const MASSIVE: bool;
    const ENCRYPTED: bool;
}
Expand description

Defines associated constants with this packet, which can be used to turn this struct into a packet.

If this struct also implements skrillax_serde::ByteSize and skrillax_serde::Serialize, it will automatically gain AsPacket. If it implements skrillax_serde::Deserialize, it will automatically gain TryFromPacket. This can automatically be derived with the derive feature.

Required Associated Constants§

Source

const ID: u16

Defines the ID or OpCode of the packet.

Source

const NAME: &'static str

Provides a more readable name for the given packet. This is usually just the struct name.

Source

const MASSIVE: bool

Defines if this packet is a massive packet, and should thus use massive frames for transport.

Source

const ENCRYPTED: bool

Defines if this packet is an encrypted packet.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§