pub trait ProtocolPacket
where
Self: Sized,
{
fn id(&self) -> u32;
fn read(id: u32, buffer: &mut std::io::Cursor<&[u8]>) -> Option<Self>;
fn write(&self, buffer: &mut impl std::io::Write) -> std::io::Result<()>;
}
pub trait IntoPacket<T> {
fn into_packet(self) -> T;
}