From e3679bf40cdc6f7da98f60b5c3f4f5b21a5c2f07 Mon Sep 17 00:00:00 2001 From: Clint Byrum Date: Thu, 20 Jun 2024 00:04:19 -0700 Subject: [PATCH] document WorkerJob::send_packet --- rustygear/src/client.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rustygear/src/client.rs b/rustygear/src/client.rs index 2990f3a..401aa96 100644 --- a/rustygear/src/client.rs +++ b/rustygear/src/client.rs @@ -230,6 +230,11 @@ impl WorkerJob { self.send_packet(packet).await } + /// Sends a [Packet] to the server + /// + /// This method is meant to be called by workers when they would like to send a + /// packet that isn't implemented by this library. Note that this does not + /// attach the job handle to the packet as that is not a part of all packets. pub async fn send_packet(&mut self, packet: Packet) -> Result<(), io::Error> { match self.sink_tx.send(packet).await { Err(_) => Err(io::Error::new(