1#[cfg(any(test, feature = "testing"))]
5use s2n_quic_core::event::snapshot;
6
7pub use s2n_quic_core::event::{Event, IntoEvent, Timestamp};
8
9pub trait Meta: core::fmt::Debug {
11 fn subject(&self) -> api::Subject;
15}
16
17impl Meta for api::ConnectionMeta {
18 fn subject(&self) -> api::Subject {
19 builder::Subject::Connection { id: self.id }.into_event()
20 }
21}
22
23impl Meta for api::EndpointMeta {
24 fn subject(&self) -> api::Subject {
25 builder::Subject::Endpoint {}.into_event()
26 }
27}
28
29#[allow(
32 clippy::panic,
33 clippy::unwrap_used,
34 clippy::unwrap_in_result,
35 clippy::panic_in_result_fn,
36 reason = "FIXME: generated event code is not yet audited for the panic lints"
37)]
38mod generated;
39pub use generated::*;
40
41pub mod metrics {
42 pub use crate::event::generated::metrics::*;
43 pub use s2n_quic_core::event::metrics::Recorder;
44
45 pub mod aggregate {
46 pub use crate::event::generated::metrics::aggregate::*;
47 pub use s2n_quic_core::event::metrics::aggregate::{
48 info, AsVariant, BoolRecorder, Info, Metric, NominalRecorder, Recorder, Registry, Units,
49 };
50
51 pub mod probe {
52 pub use crate::event::generated::metrics::probe::*;
53 pub use s2n_quic_core::event::metrics::aggregate::probe::dynamic;
54 }
55 }
56}
57
58pub mod disabled {
59 #[derive(Clone, Debug, Default)]
60 pub struct Subscriber(());
61
62 impl super::Subscriber for Subscriber {
63 type ConnectionContext = ();
64
65 #[inline]
66 fn create_connection_context(
67 &self,
68 _meta: &super::api::ConnectionMeta,
69 _info: &super::api::ConnectionInfo,
70 ) -> Self::ConnectionContext {
71 }
72 }
73}