pub trait Packet: Sized {
const PACKET_ID: i32;
// Required methods
fn decode(buf: &mut impl Buf) -> Result<Self, ProtocolError>;
fn encode(&self, buf: &mut impl BufMut);
}Expand description
Trait implemented by all typed packets.
Required Associated Constants§
Required Methods§
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.