pub trait Packable {
const PACKET_TYPE: PacketType;
// Provided method
fn pack(&self) -> TofPacket
where Self: Serialization { ... }
}
Expand description
Can be wrapped within a TofPacket. To do, we just have to define a packet type
Required Associated Constants§
const PACKET_TYPE: PacketType
Provided Methods§
Sourcefn pack(&self) -> TofPacketwhere
Self: Serialization,
fn pack(&self) -> TofPacketwhere
Self: Serialization,
Wrap myself in a TofPacket
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.