pub trait WritePacket: Write { // Provided method fn write_packet(&mut self, packet: &Packet<'_>) -> Result<()> { ... } }