pub async fn write(&mut self, packet: &Packet) -> Result<()> {
        let bytes = serde_json::to_string(packet)?;

        self.buffer.write(bytes.as_bytes()).await?;
        self.buffer.write(b"\n").await?;

        Ok(())
    }
/// Write a packet to the file
Write a packet to the file
Write a packet to the file
pub async fn write(&mut self, packet: &Packet) -> Result<()> {
        let bytes = serde_json::to_string(packet)?;
        self.buffer.write(bytes.as_bytes()).await?;
        self.buffer.write(b"\n").await?;
        Ok(())
    }
pub async fn write ( & mut self , packet : & Packet ) -> Result < ( ) > { let bytes = serde_json :: to_string ( packet ) ? ; self . buffer . write ( bytes . as_bytes ( ) ) . await ? ; self . buffer . write ( b" \n " ) . await ? ; Ok ( ( ) ) }
Write a packet to the file
Write a packet to the file
&mut self
packet
&Packet