pub trait PacketSet: Sized {
const STATE: State;
const DIRECTION: Direction;
// Required methods
fn decode_raw(raw: &RawPacket) -> DecodeResult<Self>;
fn id(&self) -> i32;
fn name(&self) -> &'static str;
fn encode_body(&self, w: &mut BytesMut) -> EncodeResult;
fn name_of(id: i32) -> Option<&'static str>;
}Expand description
All packets of one version, state and direction as an enum (generated).
Required Associated Constants§
Required Methods§
Sourcefn decode_raw(raw: &RawPacket) -> DecodeResult<Self>
fn decode_raw(raw: &RawPacket) -> DecodeResult<Self>
Decodes a raw packet into the matching variant (strict: no trailing bytes).
Sourcefn encode_body(&self, w: &mut BytesMut) -> EncodeResult
fn encode_body(&self, w: &mut BytesMut) -> EncodeResult
Encodes the packet body (without the id).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".