azalea_protocol::packets

Trait ProtocolPacket

Source
pub trait ProtocolPacket
where Self: Sized,
{ // Required methods fn id(&self) -> u32; fn read( id: u32, buf: &mut Cursor<&[u8]>, ) -> Result<Self, Box<ReadPacketError>>; fn write(&self, buf: &mut impl Write) -> Result<(), Error>; }
Expand description

An enum of packets for a certain protocol

Required Methods§

Source

fn id(&self) -> u32

Source

fn read(id: u32, buf: &mut Cursor<&[u8]>) -> Result<Self, Box<ReadPacketError>>

Read a packet by its id, ConnectionProtocol, and flow

Source

fn write(&self, buf: &mut impl Write) -> Result<(), Error>

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.

Implementors§