pub trait Packet: Sized {
// Required methods
fn encode(&self) -> Vec<u8> ⓘ;
fn decode(bytes: &[u8]) -> Option<Self>;
}Expand description
A typed packet that can be encoded to / decoded from a raw byte buffer.
Implement this trait via the packet! macro — do not implement manually.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".