Skip to content

Commit

Permalink
document WorkerJob::send_packet
Browse files Browse the repository at this point in the history
  • Loading branch information
SpamapS committed Jun 20, 2024
1 parent 5b77bfc commit e3679bf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions rustygear/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit e3679bf

Please sign in to comment.