pub trait PacketParse: Sized {
// Required method
fn parse(bytes: &[u8]) -> Result<Self, CommunicationError>;
}Expand description
Trait for packet parsing
Implemented by packet types that can be deserialized from received bytes. The input bytes should contain only the payload data, with the protocol header already processed and removed.
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.