Trait durian::Packet

source ·
pub trait Packet {
    // Required method
    fn as_bytes(&self) -> Bytes;
}
Expand description

Packet trait that allows a struct to be sent through PacketManager, for serializing

This is automatically implemented if using the macros bincode_packet, BinPacket, or UnitPacket.

Required Methods§

source

fn as_bytes(&self) -> Bytes

Return a serialized form of the Packet as Bytes

Implementors§