Skip to content

Commit 8162658

Browse files
committed
swarm: Implement Debug for OneShotHandler
1 parent 79fc6f1 commit 8162658

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

swarm/src/handler/one_shot.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,19 @@ where
112112
}
113113
}
114114

115+
impl<TInbound, TOutbound, TEvent> std::fmt::Debug for OneShotHandler<TInbound, TOutbound, TEvent>
116+
where
117+
TOutbound: std::fmt::Debug + OutboundUpgradeSend,
118+
{
119+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
120+
f.debug_struct("OneShotHandler")
121+
.field("pending_requests", &self.pending_requests())
122+
.field("dial_negotiated", &self.dial_negotiated)
123+
.field("dial_queue_len", &self.dial_queue.len())
124+
.finish()
125+
}
126+
}
127+
115128
impl<TInbound, TOutbound, TEvent> ConnectionHandler for OneShotHandler<TInbound, TOutbound, TEvent>
116129
where
117130
TInbound: InboundUpgradeSend + Send + 'static,

0 commit comments

Comments
 (0)