pub trait Packet: Sized {
// Required methods
fn to_payload(&self) -> Vec<u8> ⓘ;
fn from_payload(bytes: &[u8]) -> Option<Self>;
}Expand description
A packet’s payload as bytes and back — every Schema type is one.
Required Methods§
fn to_payload(&self) -> Vec<u8> ⓘ
Sourcefn from_payload(bytes: &[u8]) -> Option<Self>
fn from_payload(bytes: &[u8]) -> Option<Self>
None for bytes that aren’t this packet.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".