diff --git a/cove-server/src/conn.rs b/cove-server/src/conn.rs index 91cd71e..4ca2153 100644 --- a/cove-server/src/conn.rs +++ b/cove-server/src/conn.rs @@ -1,6 +1,6 @@ -use std::result; use std::sync::Arc; use std::time::Duration; +use std::{fmt, result}; use cove_core::packets::Packet; use futures::stream::{SplitSink, SplitStream}; @@ -35,6 +35,12 @@ pub struct ConnTx { tx: UnboundedSender, } +impl fmt::Debug for ConnTx { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("ConnTx").finish_non_exhaustive() + } +} + impl ConnTx { pub fn send(&self, packet: &Packet) -> Result<()> { let msg = Message::Text(serde_json::to_string(packet)?); @@ -48,6 +54,12 @@ pub struct ConnRx { last_ping_payload: Arc>>, } +impl fmt::Debug for ConnRx { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("ConnRx").finish_non_exhaustive() + } +} + impl ConnRx { pub async fn recv(&mut self) -> Result> { loop { @@ -84,6 +96,12 @@ pub struct ConnMaintenance { last_ping_payload: Arc>>, } +impl fmt::Debug for ConnMaintenance { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("ConnMaintenance").finish_non_exhaustive() + } +} + impl ConnMaintenance { pub async fn perform(self) -> Result<()> { let result = try_join!(