Skip to content

Commit 732987f

Browse files
committed
add some comments for implementing Subscriber trait for NoopSubscriber
1 parent 355d7bf commit 732987f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dc/s2n-quic-dc/src/testing.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
use crate::{
5-
event::{self, Subscriber},
5+
event,
66
path::secret::{stateless_reset::Signer, Map},
77
psk::{client, server},
88
};
@@ -168,12 +168,13 @@ pub(crate) fn query_event(_connection: &mut Connection, _limiter_duration: Durat
168168
#[derive(Clone, Default)]
169169
pub struct NoopSubscriber;
170170

171-
impl Subscriber for NoopSubscriber {
171+
// Need to implement both s2n-quic-dc::event::Subscriber and s2n-quic-core::event::Subscriber
172+
// to fullfill the trait bounds for both client::Provider and server::Provider
173+
impl crate::event::Subscriber for NoopSubscriber {
172174
/// The context type associated with each connection
173175
/// For a no-op subscriber, we can use the unit type since we don't need to store any state
174176
type ConnectionContext = ();
175177

176-
/// Creates a context to be passed to each connection-related event
177178
fn create_connection_context(
178179
&self,
179180
_meta: &event::api::ConnectionMeta,
@@ -187,7 +188,6 @@ impl s2n_quic_core::event::Subscriber for NoopSubscriber {
187188
/// For a no-op subscriber, we can use the unit type since we don't need to store any state
188189
type ConnectionContext = ();
189190

190-
/// Creates a context to be passed to each connection-related event
191191
fn create_connection_context(
192192
&mut self,
193193
_meta: &s2n_quic_core::event::api::ConnectionMeta,

0 commit comments

Comments
 (0)