pub trait PacketComponents:
Debug
+ Hash
+ Eq
+ Sized {
// Required methods
fn values(&self) -> (u16, u16);
fn from_values(component: u16, command: u16, notify: bool) -> Option<Self>;
// Provided method
fn from_header(header: &PacketHeader) -> Option<Self> { ... }
}Expand description
Trait implemented by structures that can be used as packet components
Required Methods§
Provided Methods§
Sourcefn from_header(header: &PacketHeader) -> Option<Self>
fn from_header(header: &PacketHeader) -> Option<Self>
Decodes the packet component using the details stored in the provided packet header
header The packet header to decode from
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".