s2n_quic_core/event/
generated.rs

1// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2// SPDX-License-Identifier: Apache-2.0
3
4// DO NOT MODIFY THIS FILE
5// This file was generated with the `s2n-events` crate and any required
6// changes should be made there.
7
8#![allow(clippy::needless_lifetimes)]
9use super::*;
10pub(crate) mod metrics;
11pub mod api {
12    #![doc = r" This module contains events that are emitted to the [`Subscriber`](crate::event::Subscriber)"]
13    use super::*;
14    #[allow(unused_imports)]
15    use crate::event::metrics::aggregate;
16    pub use traits::Subscriber;
17    #[derive(Clone, Debug)]
18    #[non_exhaustive]
19    pub struct ConnectionMeta {
20        pub endpoint_type: EndpointType,
21        pub id: u64,
22        pub timestamp: crate::event::Timestamp,
23    }
24    #[cfg(any(test, feature = "testing"))]
25    impl crate::event::snapshot::Fmt for ConnectionMeta {
26        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
27            let mut fmt = fmt.debug_struct("ConnectionMeta");
28            fmt.field("endpoint_type", &self.endpoint_type);
29            fmt.field("id", &self.id);
30            fmt.field("timestamp", &self.timestamp);
31            fmt.finish()
32        }
33    }
34    #[derive(Clone, Debug)]
35    #[non_exhaustive]
36    pub struct EndpointMeta {
37        pub endpoint_type: EndpointType,
38        pub timestamp: crate::event::Timestamp,
39    }
40    #[cfg(any(test, feature = "testing"))]
41    impl crate::event::snapshot::Fmt for EndpointMeta {
42        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
43            let mut fmt = fmt.debug_struct("EndpointMeta");
44            fmt.field("endpoint_type", &self.endpoint_type);
45            fmt.field("timestamp", &self.timestamp);
46            fmt.finish()
47        }
48    }
49    #[derive(Clone, Debug)]
50    #[non_exhaustive]
51    pub struct ConnectionInfo<'a> {
52        pub application: Option<&'a (dyn core::any::Any + Send + Sync)>,
53    }
54    #[cfg(any(test, feature = "testing"))]
55    impl<'a> crate::event::snapshot::Fmt for ConnectionInfo<'a> {
56        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
57            let mut fmt = fmt.debug_struct("ConnectionInfo");
58            fmt.field("application", &self.application);
59            fmt.finish()
60        }
61    }
62    #[derive(Clone, Debug)]
63    #[non_exhaustive]
64    pub struct TransportParameters<'a> {
65        pub original_destination_connection_id: Option<ConnectionId<'a>>,
66        pub initial_source_connection_id: Option<ConnectionId<'a>>,
67        pub retry_source_connection_id: Option<ConnectionId<'a>>,
68        pub stateless_reset_token: Option<&'a [u8]>,
69        pub preferred_address: Option<PreferredAddress<'a>>,
70        pub migration_support: bool,
71        pub max_idle_timeout: Duration,
72        pub ack_delay_exponent: u8,
73        pub max_ack_delay: Duration,
74        pub max_udp_payload_size: u64,
75        pub active_connection_id_limit: u64,
76        pub initial_max_stream_data_bidi_local: u64,
77        pub initial_max_stream_data_bidi_remote: u64,
78        pub initial_max_stream_data_uni: u64,
79        pub initial_max_streams_bidi: u64,
80        pub initial_max_streams_uni: u64,
81        pub max_datagram_frame_size: u64,
82        pub dc_supported_versions: &'a [u32],
83        pub mtu_probing_complete_support: bool,
84    }
85    #[cfg(any(test, feature = "testing"))]
86    impl<'a> crate::event::snapshot::Fmt for TransportParameters<'a> {
87        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
88            let mut fmt = fmt.debug_struct("TransportParameters");
89            fmt.field(
90                "original_destination_connection_id",
91                &self.original_destination_connection_id,
92            );
93            fmt.field(
94                "initial_source_connection_id",
95                &self.initial_source_connection_id,
96            );
97            fmt.field(
98                "retry_source_connection_id",
99                &self.retry_source_connection_id,
100            );
101            fmt.field("stateless_reset_token", &self.stateless_reset_token);
102            fmt.field("preferred_address", &self.preferred_address);
103            fmt.field("migration_support", &self.migration_support);
104            fmt.field("max_idle_timeout", &self.max_idle_timeout);
105            fmt.field("ack_delay_exponent", &self.ack_delay_exponent);
106            fmt.field("max_ack_delay", &self.max_ack_delay);
107            fmt.field("max_udp_payload_size", &self.max_udp_payload_size);
108            fmt.field(
109                "active_connection_id_limit",
110                &self.active_connection_id_limit,
111            );
112            fmt.field(
113                "initial_max_stream_data_bidi_local",
114                &self.initial_max_stream_data_bidi_local,
115            );
116            fmt.field(
117                "initial_max_stream_data_bidi_remote",
118                &self.initial_max_stream_data_bidi_remote,
119            );
120            fmt.field(
121                "initial_max_stream_data_uni",
122                &self.initial_max_stream_data_uni,
123            );
124            fmt.field("initial_max_streams_bidi", &self.initial_max_streams_bidi);
125            fmt.field("initial_max_streams_uni", &self.initial_max_streams_uni);
126            fmt.field("max_datagram_frame_size", &self.max_datagram_frame_size);
127            fmt.field("dc_supported_versions", &self.dc_supported_versions);
128            fmt.field(
129                "mtu_probing_complete_support",
130                &self.mtu_probing_complete_support,
131            );
132            fmt.finish()
133        }
134    }
135    #[derive(Clone, Debug)]
136    #[non_exhaustive]
137    pub struct PreferredAddress<'a> {
138        pub ipv4_address: Option<SocketAddress<'a>>,
139        pub ipv6_address: Option<SocketAddress<'a>>,
140        pub connection_id: ConnectionId<'a>,
141        pub stateless_reset_token: &'a [u8],
142    }
143    #[cfg(any(test, feature = "testing"))]
144    impl<'a> crate::event::snapshot::Fmt for PreferredAddress<'a> {
145        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
146            let mut fmt = fmt.debug_struct("PreferredAddress");
147            fmt.field("ipv4_address", &self.ipv4_address);
148            fmt.field("ipv6_address", &self.ipv6_address);
149            fmt.field("connection_id", &self.connection_id);
150            fmt.field("stateless_reset_token", &self.stateless_reset_token);
151            fmt.finish()
152        }
153    }
154    #[derive(Clone, Debug)]
155    #[non_exhaustive]
156    pub struct Path<'a> {
157        pub local_addr: SocketAddress<'a>,
158        pub local_cid: ConnectionId<'a>,
159        pub remote_addr: SocketAddress<'a>,
160        pub remote_cid: ConnectionId<'a>,
161        pub id: u64,
162        pub is_active: bool,
163    }
164    #[cfg(any(test, feature = "testing"))]
165    impl<'a> crate::event::snapshot::Fmt for Path<'a> {
166        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
167            let mut fmt = fmt.debug_struct("Path");
168            fmt.field("local_addr", &self.local_addr);
169            fmt.field("local_cid", &self.local_cid);
170            fmt.field("remote_addr", &self.remote_addr);
171            fmt.field("remote_cid", &self.remote_cid);
172            fmt.field("id", &self.id);
173            fmt.field("is_active", &self.is_active);
174            fmt.finish()
175        }
176    }
177    #[non_exhaustive]
178    #[derive(Clone)]
179    pub struct ConnectionId<'a> {
180        pub bytes: &'a [u8],
181    }
182    #[cfg(any(test, feature = "testing"))]
183    impl<'a> crate::event::snapshot::Fmt for ConnectionId<'a> {
184        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
185            let mut fmt = fmt.debug_struct("ConnectionId");
186            fmt.field("bytes", &self.bytes);
187            fmt.finish()
188        }
189    }
190    #[derive(Clone, Debug)]
191    #[non_exhaustive]
192    pub struct EcnCounts {
193        #[doc = " A variable-length integer representing the total number of packets"]
194        #[doc = " received with the ECT(0) codepoint."]
195        pub ect_0_count: u64,
196        #[doc = " A variable-length integer representing the total number of packets"]
197        #[doc = " received with the ECT(1) codepoint."]
198        pub ect_1_count: u64,
199        #[doc = " A variable-length integer representing the total number of packets"]
200        #[doc = " received with the CE codepoint."]
201        pub ce_count: u64,
202    }
203    #[cfg(any(test, feature = "testing"))]
204    impl crate::event::snapshot::Fmt for EcnCounts {
205        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
206            let mut fmt = fmt.debug_struct("EcnCounts");
207            fmt.field("ect_0_count", &self.ect_0_count);
208            fmt.field("ect_1_count", &self.ect_1_count);
209            fmt.field("ce_count", &self.ce_count);
210            fmt.finish()
211        }
212    }
213    #[non_exhaustive]
214    #[derive(Clone)]
215    pub struct ConnectionCloseFrame<'a> {
216        pub error_code: u64,
217        pub frame_type: Option<u64>,
218        pub reason: Option<&'a [u8]>,
219    }
220    #[cfg(any(test, feature = "testing"))]
221    impl<'a> crate::event::snapshot::Fmt for ConnectionCloseFrame<'a> {
222        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
223            let mut fmt = fmt.debug_struct("ConnectionCloseFrame");
224            fmt.field("error_code", &self.error_code);
225            fmt.field("frame_type", &self.frame_type);
226            fmt.field("reason", &self.reason);
227            fmt.finish()
228        }
229    }
230    #[derive(Clone, Debug)]
231    #[non_exhaustive]
232    pub struct MtuConfig {
233        pub initial_mtu: u16,
234        pub base_mtu: u16,
235        pub max_mtu: u16,
236    }
237    #[cfg(any(test, feature = "testing"))]
238    impl crate::event::snapshot::Fmt for MtuConfig {
239        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
240            let mut fmt = fmt.debug_struct("MtuConfig");
241            fmt.field("initial_mtu", &self.initial_mtu);
242            fmt.field("base_mtu", &self.base_mtu);
243            fmt.field("max_mtu", &self.max_mtu);
244            fmt.finish()
245        }
246    }
247    #[derive(Clone, Debug)]
248    #[non_exhaustive]
249    #[doc = " A bandwidth delivery rate estimate with associated metadata"]
250    pub struct RateSample {
251        #[doc = " The length of the sampling interval"]
252        pub interval: Duration,
253        #[doc = " The amount of data in bytes marked as delivered over the sampling interval"]
254        pub delivered_bytes: u64,
255        #[doc = " The amount of data in bytes marked as lost over the sampling interval"]
256        pub lost_bytes: u64,
257        #[doc = " The number of packets marked as explicit congestion experienced over the sampling interval"]
258        pub ecn_ce_count: u64,
259        #[doc = " PacketInfo::is_app_limited from the most recent acknowledged packet"]
260        pub is_app_limited: bool,
261        #[doc = " PacketInfo::delivered_bytes from the most recent acknowledged packet"]
262        pub prior_delivered_bytes: u64,
263        #[doc = " PacketInfo::bytes_in_flight from the most recent acknowledged packet"]
264        pub bytes_in_flight: u32,
265        #[doc = " PacketInfo::lost_bytes from the most recent acknowledged packet"]
266        pub prior_lost_bytes: u64,
267        #[doc = " PacketInfo::ecn_ce_count from the most recent acknowledged packet"]
268        pub prior_ecn_ce_count: u64,
269        #[doc = " The delivery rate for this rate sample"]
270        pub delivery_rate_bytes_per_second: u64,
271    }
272    #[cfg(any(test, feature = "testing"))]
273    impl crate::event::snapshot::Fmt for RateSample {
274        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
275            let mut fmt = fmt.debug_struct("RateSample");
276            fmt.field("interval", &self.interval);
277            fmt.field("delivered_bytes", &self.delivered_bytes);
278            fmt.field("lost_bytes", &self.lost_bytes);
279            fmt.field("ecn_ce_count", &self.ecn_ce_count);
280            fmt.field("is_app_limited", &self.is_app_limited);
281            fmt.field("prior_delivered_bytes", &self.prior_delivered_bytes);
282            fmt.field("bytes_in_flight", &self.bytes_in_flight);
283            fmt.field("prior_lost_bytes", &self.prior_lost_bytes);
284            fmt.field("prior_ecn_ce_count", &self.prior_ecn_ce_count);
285            fmt.field(
286                "delivery_rate_bytes_per_second",
287                &self.delivery_rate_bytes_per_second,
288            );
289            fmt.finish()
290        }
291    }
292    #[non_exhaustive]
293    #[derive(Clone)]
294    pub enum SocketAddress<'a> {
295        #[non_exhaustive]
296        IpV4 { ip: &'a [u8; 4], port: u16 },
297        #[non_exhaustive]
298        IpV6 { ip: &'a [u8; 16], port: u16 },
299    }
300    impl<'a> aggregate::AsVariant for SocketAddress<'a> {
301        const VARIANTS: &'static [aggregate::info::Variant] = &[
302            aggregate::info::variant::Builder {
303                name: aggregate::info::Str::new("IP_V4\0"),
304                id: 0usize,
305            }
306            .build(),
307            aggregate::info::variant::Builder {
308                name: aggregate::info::Str::new("IP_V6\0"),
309                id: 1usize,
310            }
311            .build(),
312        ];
313        #[inline]
314        fn variant_idx(&self) -> usize {
315            match self {
316                Self::IpV4 { .. } => 0usize,
317                Self::IpV6 { .. } => 1usize,
318            }
319        }
320    }
321    #[derive(Clone, Debug)]
322    #[non_exhaustive]
323    pub enum DuplicatePacketError {
324        #[non_exhaustive]
325        #[doc = " The packet number was already received and is a duplicate."]
326        Duplicate {},
327        #[non_exhaustive]
328        #[doc = " The received packet number was outside the range of tracked packet numbers."]
329        #[doc = ""]
330        #[doc = " This can happen when packets are heavily delayed or reordered. Currently, the maximum"]
331        #[doc = " amount of reordering is limited to 128 packets. For example, if packet number `142`"]
332        #[doc = " is received, the allowed range would be limited to `14-142`. If an endpoint received"]
333        #[doc = " packet `< 14`, it would trigger this event."]
334        TooOld {},
335    }
336    impl aggregate::AsVariant for DuplicatePacketError {
337        const VARIANTS: &'static [aggregate::info::Variant] = &[
338            aggregate::info::variant::Builder {
339                name: aggregate::info::Str::new("DUPLICATE\0"),
340                id: 0usize,
341            }
342            .build(),
343            aggregate::info::variant::Builder {
344                name: aggregate::info::Str::new("TOO_OLD\0"),
345                id: 1usize,
346            }
347            .build(),
348        ];
349        #[inline]
350        fn variant_idx(&self) -> usize {
351            match self {
352                Self::Duplicate { .. } => 0usize,
353                Self::TooOld { .. } => 1usize,
354            }
355        }
356    }
357    #[derive(Clone, Debug)]
358    #[non_exhaustive]
359    pub enum Frame {
360        #[non_exhaustive]
361        Padding {},
362        #[non_exhaustive]
363        Ping {},
364        #[non_exhaustive]
365        Ack {
366            ecn_counts: Option<EcnCounts>,
367            largest_acknowledged: u64,
368            ack_range_count: u64,
369        },
370        #[non_exhaustive]
371        ResetStream {
372            id: u64,
373            error_code: u64,
374            final_size: u64,
375        },
376        #[non_exhaustive]
377        StopSending { id: u64, error_code: u64 },
378        #[non_exhaustive]
379        Crypto { offset: u64, len: u16 },
380        #[non_exhaustive]
381        NewToken {},
382        #[non_exhaustive]
383        Stream {
384            id: u64,
385            offset: u64,
386            len: u16,
387            is_fin: bool,
388        },
389        #[non_exhaustive]
390        MaxData { value: u64 },
391        #[non_exhaustive]
392        MaxStreamData {
393            stream_type: StreamType,
394            id: u64,
395            value: u64,
396        },
397        #[non_exhaustive]
398        MaxStreams { stream_type: StreamType, value: u64 },
399        #[non_exhaustive]
400        DataBlocked { data_limit: u64 },
401        #[non_exhaustive]
402        StreamDataBlocked {
403            stream_id: u64,
404            stream_data_limit: u64,
405        },
406        #[non_exhaustive]
407        StreamsBlocked {
408            stream_type: StreamType,
409            stream_limit: u64,
410        },
411        #[non_exhaustive]
412        NewConnectionId {
413            sequence_number: u64,
414            retire_prior_to: u64,
415        },
416        #[non_exhaustive]
417        RetireConnectionId {},
418        #[non_exhaustive]
419        PathChallenge {},
420        #[non_exhaustive]
421        PathResponse {},
422        #[non_exhaustive]
423        ConnectionClose {},
424        #[non_exhaustive]
425        HandshakeDone {},
426        #[non_exhaustive]
427        Datagram { len: u16 },
428        #[non_exhaustive]
429        DcStatelessResetTokens {},
430        #[non_exhaustive]
431        MtuProbingComplete { mtu: u16 },
432    }
433    impl aggregate::AsVariant for Frame {
434        const VARIANTS: &'static [aggregate::info::Variant] = &[
435            aggregate::info::variant::Builder {
436                name: aggregate::info::Str::new("PADDING\0"),
437                id: 0usize,
438            }
439            .build(),
440            aggregate::info::variant::Builder {
441                name: aggregate::info::Str::new("PING\0"),
442                id: 1usize,
443            }
444            .build(),
445            aggregate::info::variant::Builder {
446                name: aggregate::info::Str::new("ACK\0"),
447                id: 2usize,
448            }
449            .build(),
450            aggregate::info::variant::Builder {
451                name: aggregate::info::Str::new("RESET_STREAM\0"),
452                id: 3usize,
453            }
454            .build(),
455            aggregate::info::variant::Builder {
456                name: aggregate::info::Str::new("STOP_SENDING\0"),
457                id: 4usize,
458            }
459            .build(),
460            aggregate::info::variant::Builder {
461                name: aggregate::info::Str::new("CRYPTO\0"),
462                id: 5usize,
463            }
464            .build(),
465            aggregate::info::variant::Builder {
466                name: aggregate::info::Str::new("NEW_TOKEN\0"),
467                id: 6usize,
468            }
469            .build(),
470            aggregate::info::variant::Builder {
471                name: aggregate::info::Str::new("STREAM\0"),
472                id: 7usize,
473            }
474            .build(),
475            aggregate::info::variant::Builder {
476                name: aggregate::info::Str::new("MAX_DATA\0"),
477                id: 8usize,
478            }
479            .build(),
480            aggregate::info::variant::Builder {
481                name: aggregate::info::Str::new("MAX_STREAM_DATA\0"),
482                id: 9usize,
483            }
484            .build(),
485            aggregate::info::variant::Builder {
486                name: aggregate::info::Str::new("MAX_STREAMS\0"),
487                id: 10usize,
488            }
489            .build(),
490            aggregate::info::variant::Builder {
491                name: aggregate::info::Str::new("DATA_BLOCKED\0"),
492                id: 11usize,
493            }
494            .build(),
495            aggregate::info::variant::Builder {
496                name: aggregate::info::Str::new("STREAM_DATA_BLOCKED\0"),
497                id: 12usize,
498            }
499            .build(),
500            aggregate::info::variant::Builder {
501                name: aggregate::info::Str::new("STREAMS_BLOCKED\0"),
502                id: 13usize,
503            }
504            .build(),
505            aggregate::info::variant::Builder {
506                name: aggregate::info::Str::new("NEW_CONNECTION_ID\0"),
507                id: 14usize,
508            }
509            .build(),
510            aggregate::info::variant::Builder {
511                name: aggregate::info::Str::new("RETIRE_CONNECTION_ID\0"),
512                id: 15usize,
513            }
514            .build(),
515            aggregate::info::variant::Builder {
516                name: aggregate::info::Str::new("PATH_CHALLENGE\0"),
517                id: 16usize,
518            }
519            .build(),
520            aggregate::info::variant::Builder {
521                name: aggregate::info::Str::new("PATH_RESPONSE\0"),
522                id: 17usize,
523            }
524            .build(),
525            aggregate::info::variant::Builder {
526                name: aggregate::info::Str::new("CONNECTION_CLOSE\0"),
527                id: 18usize,
528            }
529            .build(),
530            aggregate::info::variant::Builder {
531                name: aggregate::info::Str::new("HANDSHAKE_DONE\0"),
532                id: 19usize,
533            }
534            .build(),
535            aggregate::info::variant::Builder {
536                name: aggregate::info::Str::new("DATAGRAM\0"),
537                id: 20usize,
538            }
539            .build(),
540            aggregate::info::variant::Builder {
541                name: aggregate::info::Str::new("DC_STATELESS_RESET_TOKENS\0"),
542                id: 21usize,
543            }
544            .build(),
545            aggregate::info::variant::Builder {
546                name: aggregate::info::Str::new("MTU_PROBING_COMPLETE\0"),
547                id: 22usize,
548            }
549            .build(),
550        ];
551        #[inline]
552        fn variant_idx(&self) -> usize {
553            match self {
554                Self::Padding { .. } => 0usize,
555                Self::Ping { .. } => 1usize,
556                Self::Ack { .. } => 2usize,
557                Self::ResetStream { .. } => 3usize,
558                Self::StopSending { .. } => 4usize,
559                Self::Crypto { .. } => 5usize,
560                Self::NewToken { .. } => 6usize,
561                Self::Stream { .. } => 7usize,
562                Self::MaxData { .. } => 8usize,
563                Self::MaxStreamData { .. } => 9usize,
564                Self::MaxStreams { .. } => 10usize,
565                Self::DataBlocked { .. } => 11usize,
566                Self::StreamDataBlocked { .. } => 12usize,
567                Self::StreamsBlocked { .. } => 13usize,
568                Self::NewConnectionId { .. } => 14usize,
569                Self::RetireConnectionId { .. } => 15usize,
570                Self::PathChallenge { .. } => 16usize,
571                Self::PathResponse { .. } => 17usize,
572                Self::ConnectionClose { .. } => 18usize,
573                Self::HandshakeDone { .. } => 19usize,
574                Self::Datagram { .. } => 20usize,
575                Self::DcStatelessResetTokens { .. } => 21usize,
576                Self::MtuProbingComplete { .. } => 22usize,
577            }
578        }
579    }
580    #[derive(Clone, Debug)]
581    #[non_exhaustive]
582    pub enum StreamType {
583        #[non_exhaustive]
584        Bidirectional {},
585        #[non_exhaustive]
586        Unidirectional {},
587    }
588    impl aggregate::AsVariant for StreamType {
589        const VARIANTS: &'static [aggregate::info::Variant] = &[
590            aggregate::info::variant::Builder {
591                name: aggregate::info::Str::new("BIDIRECTIONAL\0"),
592                id: 0usize,
593            }
594            .build(),
595            aggregate::info::variant::Builder {
596                name: aggregate::info::Str::new("UNIDIRECTIONAL\0"),
597                id: 1usize,
598            }
599            .build(),
600        ];
601        #[inline]
602        fn variant_idx(&self) -> usize {
603            match self {
604                Self::Bidirectional { .. } => 0usize,
605                Self::Unidirectional { .. } => 1usize,
606            }
607        }
608    }
609    #[derive(Clone, Debug)]
610    #[non_exhaustive]
611    pub enum PacketHeader {
612        #[non_exhaustive]
613        Initial { number: u64, version: u32 },
614        #[non_exhaustive]
615        Handshake { number: u64, version: u32 },
616        #[non_exhaustive]
617        ZeroRtt { number: u64, version: u32 },
618        #[non_exhaustive]
619        OneRtt { number: u64 },
620        #[non_exhaustive]
621        Retry { version: u32 },
622        #[non_exhaustive]
623        VersionNegotiation {},
624        #[non_exhaustive]
625        StatelessReset {},
626    }
627    impl aggregate::AsVariant for PacketHeader {
628        const VARIANTS: &'static [aggregate::info::Variant] = &[
629            aggregate::info::variant::Builder {
630                name: aggregate::info::Str::new("INITIAL\0"),
631                id: 0usize,
632            }
633            .build(),
634            aggregate::info::variant::Builder {
635                name: aggregate::info::Str::new("HANDSHAKE\0"),
636                id: 1usize,
637            }
638            .build(),
639            aggregate::info::variant::Builder {
640                name: aggregate::info::Str::new("ZERO_RTT\0"),
641                id: 2usize,
642            }
643            .build(),
644            aggregate::info::variant::Builder {
645                name: aggregate::info::Str::new("ONE_RTT\0"),
646                id: 3usize,
647            }
648            .build(),
649            aggregate::info::variant::Builder {
650                name: aggregate::info::Str::new("RETRY\0"),
651                id: 4usize,
652            }
653            .build(),
654            aggregate::info::variant::Builder {
655                name: aggregate::info::Str::new("VERSION_NEGOTIATION\0"),
656                id: 5usize,
657            }
658            .build(),
659            aggregate::info::variant::Builder {
660                name: aggregate::info::Str::new("STATELESS_RESET\0"),
661                id: 6usize,
662            }
663            .build(),
664        ];
665        #[inline]
666        fn variant_idx(&self) -> usize {
667            match self {
668                Self::Initial { .. } => 0usize,
669                Self::Handshake { .. } => 1usize,
670                Self::ZeroRtt { .. } => 2usize,
671                Self::OneRtt { .. } => 3usize,
672                Self::Retry { .. } => 4usize,
673                Self::VersionNegotiation { .. } => 5usize,
674                Self::StatelessReset { .. } => 6usize,
675            }
676        }
677    }
678    #[derive(Clone, Debug)]
679    #[non_exhaustive]
680    pub enum PacketType {
681        #[non_exhaustive]
682        Initial {},
683        #[non_exhaustive]
684        Handshake {},
685        #[non_exhaustive]
686        ZeroRtt {},
687        #[non_exhaustive]
688        OneRtt {},
689        #[non_exhaustive]
690        Retry {},
691        #[non_exhaustive]
692        VersionNegotiation {},
693        #[non_exhaustive]
694        StatelessReset {},
695    }
696    impl aggregate::AsVariant for PacketType {
697        const VARIANTS: &'static [aggregate::info::Variant] = &[
698            aggregate::info::variant::Builder {
699                name: aggregate::info::Str::new("INITIAL\0"),
700                id: 0usize,
701            }
702            .build(),
703            aggregate::info::variant::Builder {
704                name: aggregate::info::Str::new("HANDSHAKE\0"),
705                id: 1usize,
706            }
707            .build(),
708            aggregate::info::variant::Builder {
709                name: aggregate::info::Str::new("ZERO_RTT\0"),
710                id: 2usize,
711            }
712            .build(),
713            aggregate::info::variant::Builder {
714                name: aggregate::info::Str::new("ONE_RTT\0"),
715                id: 3usize,
716            }
717            .build(),
718            aggregate::info::variant::Builder {
719                name: aggregate::info::Str::new("RETRY\0"),
720                id: 4usize,
721            }
722            .build(),
723            aggregate::info::variant::Builder {
724                name: aggregate::info::Str::new("VERSION_NEGOTIATION\0"),
725                id: 5usize,
726            }
727            .build(),
728            aggregate::info::variant::Builder {
729                name: aggregate::info::Str::new("STATELESS_RESET\0"),
730                id: 6usize,
731            }
732            .build(),
733        ];
734        #[inline]
735        fn variant_idx(&self) -> usize {
736            match self {
737                Self::Initial { .. } => 0usize,
738                Self::Handshake { .. } => 1usize,
739                Self::ZeroRtt { .. } => 2usize,
740                Self::OneRtt { .. } => 3usize,
741                Self::Retry { .. } => 4usize,
742                Self::VersionNegotiation { .. } => 5usize,
743                Self::StatelessReset { .. } => 6usize,
744            }
745        }
746    }
747    #[derive(Clone, Debug)]
748    #[non_exhaustive]
749    pub enum KeyType {
750        #[non_exhaustive]
751        Initial {},
752        #[non_exhaustive]
753        Handshake {},
754        #[non_exhaustive]
755        ZeroRtt {},
756        #[non_exhaustive]
757        OneRtt { generation: u16 },
758    }
759    impl aggregate::AsVariant for KeyType {
760        const VARIANTS: &'static [aggregate::info::Variant] = &[
761            aggregate::info::variant::Builder {
762                name: aggregate::info::Str::new("INITIAL\0"),
763                id: 0usize,
764            }
765            .build(),
766            aggregate::info::variant::Builder {
767                name: aggregate::info::Str::new("HANDSHAKE\0"),
768                id: 1usize,
769            }
770            .build(),
771            aggregate::info::variant::Builder {
772                name: aggregate::info::Str::new("ZERO_RTT\0"),
773                id: 2usize,
774            }
775            .build(),
776            aggregate::info::variant::Builder {
777                name: aggregate::info::Str::new("ONE_RTT\0"),
778                id: 3usize,
779            }
780            .build(),
781        ];
782        #[inline]
783        fn variant_idx(&self) -> usize {
784            match self {
785                Self::Initial { .. } => 0usize,
786                Self::Handshake { .. } => 1usize,
787                Self::ZeroRtt { .. } => 2usize,
788                Self::OneRtt { .. } => 3usize,
789            }
790        }
791    }
792    #[derive(Clone, Debug)]
793    #[non_exhaustive]
794    #[doc = " A context from which the event is being emitted"]
795    #[doc = ""]
796    #[doc = " An event can occur in the context of an Endpoint or Connection"]
797    pub enum Subject {
798        #[non_exhaustive]
799        Endpoint {},
800        #[non_exhaustive]
801        #[doc = " This maps to an internal connection id, which is a stable identifier across CID changes."]
802        Connection { id: u64 },
803    }
804    impl aggregate::AsVariant for Subject {
805        const VARIANTS: &'static [aggregate::info::Variant] = &[
806            aggregate::info::variant::Builder {
807                name: aggregate::info::Str::new("ENDPOINT\0"),
808                id: 0usize,
809            }
810            .build(),
811            aggregate::info::variant::Builder {
812                name: aggregate::info::Str::new("CONNECTION\0"),
813                id: 1usize,
814            }
815            .build(),
816        ];
817        #[inline]
818        fn variant_idx(&self) -> usize {
819            match self {
820                Self::Endpoint { .. } => 0usize,
821                Self::Connection { .. } => 1usize,
822            }
823        }
824    }
825    #[derive(Clone, Debug)]
826    #[doc = " An endpoint may be either a Server or a Client"]
827    pub enum EndpointType {
828        #[non_exhaustive]
829        Server {},
830        #[non_exhaustive]
831        Client {},
832    }
833    impl aggregate::AsVariant for EndpointType {
834        const VARIANTS: &'static [aggregate::info::Variant] = &[
835            aggregate::info::variant::Builder {
836                name: aggregate::info::Str::new("SERVER\0"),
837                id: 0usize,
838            }
839            .build(),
840            aggregate::info::variant::Builder {
841                name: aggregate::info::Str::new("CLIENT\0"),
842                id: 1usize,
843            }
844            .build(),
845        ];
846        #[inline]
847        fn variant_idx(&self) -> usize {
848            match self {
849                Self::Server { .. } => 0usize,
850                Self::Client { .. } => 1usize,
851            }
852        }
853    }
854    #[derive(Clone, Debug)]
855    #[non_exhaustive]
856    pub enum DatagramDropReason {
857        #[non_exhaustive]
858        #[doc = " There was an error while attempting to decode the datagram."]
859        DecodingFailed {},
860        #[non_exhaustive]
861        #[doc = " There was an error while parsing the Retry token."]
862        InvalidRetryToken {},
863        #[non_exhaustive]
864        #[doc = " The peer specified an unsupported QUIC version."]
865        UnsupportedVersion {},
866        #[non_exhaustive]
867        #[doc = " The peer sent an invalid Destination Connection Id."]
868        InvalidDestinationConnectionId {},
869        #[non_exhaustive]
870        #[doc = " The peer sent an invalid Source Connection Id."]
871        InvalidSourceConnectionId {},
872        #[non_exhaustive]
873        #[doc = " Application provided invalid MTU configuration."]
874        InvalidMtuConfiguration {
875            #[doc = " MTU configuration for the endpoint"]
876            endpoint_mtu_config: MtuConfig,
877        },
878        #[non_exhaustive]
879        #[doc = " The Destination Connection Id is unknown and does not map to a Connection."]
880        #[doc = ""]
881        #[doc = " Connections are mapped to Destination Connections Ids (DCID) and packets"]
882        #[doc = " in a Datagram are routed to a connection based on the DCID in the first"]
883        #[doc = " packet. If a Connection is not found for the specified DCID then the"]
884        #[doc = " datagram can not be processed and is dropped."]
885        UnknownDestinationConnectionId {},
886        #[non_exhaustive]
887        #[doc = " The connection attempt was rejected."]
888        RejectedConnectionAttempt {},
889        #[non_exhaustive]
890        #[doc = " A datagram was received from an unknown server address."]
891        UnknownServerAddress {},
892        #[non_exhaustive]
893        #[doc = " The peer initiated a connection migration before the handshake was confirmed."]
894        #[doc = ""]
895        #[doc = " Note: This drop reason is no longer emitted"]
896        ConnectionMigrationDuringHandshake {},
897        #[non_exhaustive]
898        #[doc = " The attempted connection migration was rejected."]
899        RejectedConnectionMigration { reason: MigrationDenyReason },
900        #[non_exhaustive]
901        #[doc = " The maximum number of paths per connection was exceeded."]
902        PathLimitExceeded {},
903        #[non_exhaustive]
904        #[doc = " The peer initiated a connection migration without supplying enough connection IDs to use."]
905        #[doc = ""]
906        #[doc = " Note: This drop reason is no longer emitted"]
907        InsufficientConnectionIds {},
908    }
909    impl aggregate::AsVariant for DatagramDropReason {
910        const VARIANTS: &'static [aggregate::info::Variant] = &[
911            aggregate::info::variant::Builder {
912                name: aggregate::info::Str::new("DECODING_FAILED\0"),
913                id: 0usize,
914            }
915            .build(),
916            aggregate::info::variant::Builder {
917                name: aggregate::info::Str::new("INVALID_RETRY_TOKEN\0"),
918                id: 1usize,
919            }
920            .build(),
921            aggregate::info::variant::Builder {
922                name: aggregate::info::Str::new("UNSUPPORTED_VERSION\0"),
923                id: 2usize,
924            }
925            .build(),
926            aggregate::info::variant::Builder {
927                name: aggregate::info::Str::new("INVALID_DESTINATION_CONNECTION_ID\0"),
928                id: 3usize,
929            }
930            .build(),
931            aggregate::info::variant::Builder {
932                name: aggregate::info::Str::new("INVALID_SOURCE_CONNECTION_ID\0"),
933                id: 4usize,
934            }
935            .build(),
936            aggregate::info::variant::Builder {
937                name: aggregate::info::Str::new("INVALID_MTU_CONFIGURATION\0"),
938                id: 5usize,
939            }
940            .build(),
941            aggregate::info::variant::Builder {
942                name: aggregate::info::Str::new("UNKNOWN_DESTINATION_CONNECTION_ID\0"),
943                id: 6usize,
944            }
945            .build(),
946            aggregate::info::variant::Builder {
947                name: aggregate::info::Str::new("REJECTED_CONNECTION_ATTEMPT\0"),
948                id: 7usize,
949            }
950            .build(),
951            aggregate::info::variant::Builder {
952                name: aggregate::info::Str::new("UNKNOWN_SERVER_ADDRESS\0"),
953                id: 8usize,
954            }
955            .build(),
956            aggregate::info::variant::Builder {
957                name: aggregate::info::Str::new("CONNECTION_MIGRATION_DURING_HANDSHAKE\0"),
958                id: 9usize,
959            }
960            .build(),
961            aggregate::info::variant::Builder {
962                name: aggregate::info::Str::new("REJECTED_CONNECTION_MIGRATION\0"),
963                id: 10usize,
964            }
965            .build(),
966            aggregate::info::variant::Builder {
967                name: aggregate::info::Str::new("PATH_LIMIT_EXCEEDED\0"),
968                id: 11usize,
969            }
970            .build(),
971            aggregate::info::variant::Builder {
972                name: aggregate::info::Str::new("INSUFFICIENT_CONNECTION_IDS\0"),
973                id: 12usize,
974            }
975            .build(),
976        ];
977        #[inline]
978        fn variant_idx(&self) -> usize {
979            match self {
980                Self::DecodingFailed { .. } => 0usize,
981                Self::InvalidRetryToken { .. } => 1usize,
982                Self::UnsupportedVersion { .. } => 2usize,
983                Self::InvalidDestinationConnectionId { .. } => 3usize,
984                Self::InvalidSourceConnectionId { .. } => 4usize,
985                Self::InvalidMtuConfiguration { .. } => 5usize,
986                Self::UnknownDestinationConnectionId { .. } => 6usize,
987                Self::RejectedConnectionAttempt { .. } => 7usize,
988                Self::UnknownServerAddress { .. } => 8usize,
989                Self::ConnectionMigrationDuringHandshake { .. } => 9usize,
990                Self::RejectedConnectionMigration { .. } => 10usize,
991                Self::PathLimitExceeded { .. } => 11usize,
992                Self::InsufficientConnectionIds { .. } => 12usize,
993            }
994        }
995    }
996    #[derive(Clone, Debug)]
997    #[non_exhaustive]
998    pub enum KeySpace {
999        #[non_exhaustive]
1000        Initial {},
1001        #[non_exhaustive]
1002        Handshake {},
1003        #[non_exhaustive]
1004        ZeroRtt {},
1005        #[non_exhaustive]
1006        OneRtt {},
1007    }
1008    impl aggregate::AsVariant for KeySpace {
1009        const VARIANTS: &'static [aggregate::info::Variant] = &[
1010            aggregate::info::variant::Builder {
1011                name: aggregate::info::Str::new("INITIAL\0"),
1012                id: 0usize,
1013            }
1014            .build(),
1015            aggregate::info::variant::Builder {
1016                name: aggregate::info::Str::new("HANDSHAKE\0"),
1017                id: 1usize,
1018            }
1019            .build(),
1020            aggregate::info::variant::Builder {
1021                name: aggregate::info::Str::new("ZERO_RTT\0"),
1022                id: 2usize,
1023            }
1024            .build(),
1025            aggregate::info::variant::Builder {
1026                name: aggregate::info::Str::new("ONE_RTT\0"),
1027                id: 3usize,
1028            }
1029            .build(),
1030        ];
1031        #[inline]
1032        fn variant_idx(&self) -> usize {
1033            match self {
1034                Self::Initial { .. } => 0usize,
1035                Self::Handshake { .. } => 1usize,
1036                Self::ZeroRtt { .. } => 2usize,
1037                Self::OneRtt { .. } => 3usize,
1038            }
1039        }
1040    }
1041    #[derive(Clone, Debug)]
1042    #[non_exhaustive]
1043    pub enum PacketSkipReason {
1044        #[non_exhaustive]
1045        #[doc = " Skipped a packet number to elicit a quicker PTO acknowledgment"]
1046        PtoProbe {},
1047        #[non_exhaustive]
1048        #[doc = " Skipped a packet number to detect an Optimistic Ack attack"]
1049        OptimisticAckMitigation {},
1050    }
1051    impl aggregate::AsVariant for PacketSkipReason {
1052        const VARIANTS: &'static [aggregate::info::Variant] = &[
1053            aggregate::info::variant::Builder {
1054                name: aggregate::info::Str::new("PTO_PROBE\0"),
1055                id: 0usize,
1056            }
1057            .build(),
1058            aggregate::info::variant::Builder {
1059                name: aggregate::info::Str::new("OPTIMISTIC_ACK_MITIGATION\0"),
1060                id: 1usize,
1061            }
1062            .build(),
1063        ];
1064        #[inline]
1065        fn variant_idx(&self) -> usize {
1066            match self {
1067                Self::PtoProbe { .. } => 0usize,
1068                Self::OptimisticAckMitigation { .. } => 1usize,
1069            }
1070        }
1071    }
1072    #[derive(Clone, Debug)]
1073    #[non_exhaustive]
1074    pub enum PacketDropReason<'a> {
1075        #[non_exhaustive]
1076        #[doc = " A connection error occurred and is no longer able to process packets."]
1077        ConnectionError { path: Path<'a> },
1078        #[non_exhaustive]
1079        #[doc = " The handshake needed to be complete before processing the packet."]
1080        #[doc = ""]
1081        #[doc = " To ensure the connection stays secure, short packets can only be processed"]
1082        #[doc = " once the handshake has completed."]
1083        HandshakeNotComplete { path: Path<'a> },
1084        #[non_exhaustive]
1085        #[doc = " The packet contained a version which did not match the version negotiated"]
1086        #[doc = " during the handshake."]
1087        VersionMismatch { version: u32, path: Path<'a> },
1088        #[non_exhaustive]
1089        #[doc = " A datagram contained more than one destination connection ID, which is"]
1090        #[doc = " not allowed."]
1091        ConnectionIdMismatch {
1092            packet_cid: &'a [u8],
1093            path: Path<'a>,
1094        },
1095        #[non_exhaustive]
1096        #[doc = " There was a failure when attempting to remove header protection."]
1097        UnprotectFailed { space: KeySpace, path: Path<'a> },
1098        #[non_exhaustive]
1099        #[doc = " There was a failure when attempting to decrypt the packet."]
1100        DecryptionFailed {
1101            path: Path<'a>,
1102            packet_header: PacketHeader,
1103        },
1104        #[non_exhaustive]
1105        #[doc = " Packet decoding failed."]
1106        #[doc = ""]
1107        #[doc = " The payload is decoded one packet at a time. If decoding fails"]
1108        #[doc = " then the remaining packets are also discarded."]
1109        DecodingFailed { path: Path<'a> },
1110        #[non_exhaustive]
1111        #[doc = " The client received a non-empty retry token."]
1112        NonEmptyRetryToken { path: Path<'a> },
1113        #[non_exhaustive]
1114        #[doc = " A Retry packet was discarded."]
1115        RetryDiscarded {
1116            reason: RetryDiscardReason<'a>,
1117            path: Path<'a>,
1118        },
1119        #[non_exhaustive]
1120        #[doc = " The received Initial packet was not transported in a datagram of at least 1200 bytes"]
1121        UndersizedInitialPacket { path: Path<'a> },
1122        #[non_exhaustive]
1123        #[doc = " The destination connection ID in the packet was the initial connection ID but was in"]
1124        #[doc = " a non-initial packet."]
1125        InitialConnectionIdInvalidSpace {
1126            path: Path<'a>,
1127            packet_type: PacketType,
1128        },
1129        #[non_exhaustive]
1130        #[doc = " The packet space for a received packet did not exist"]
1131        PacketSpaceDoesNotExist {
1132            path: Path<'a>,
1133            packet_type: PacketType,
1134        },
1135    }
1136    impl<'a> aggregate::AsVariant for PacketDropReason<'a> {
1137        const VARIANTS: &'static [aggregate::info::Variant] = &[
1138            aggregate::info::variant::Builder {
1139                name: aggregate::info::Str::new("CONNECTION_ERROR\0"),
1140                id: 0usize,
1141            }
1142            .build(),
1143            aggregate::info::variant::Builder {
1144                name: aggregate::info::Str::new("HANDSHAKE_NOT_COMPLETE\0"),
1145                id: 1usize,
1146            }
1147            .build(),
1148            aggregate::info::variant::Builder {
1149                name: aggregate::info::Str::new("VERSION_MISMATCH\0"),
1150                id: 2usize,
1151            }
1152            .build(),
1153            aggregate::info::variant::Builder {
1154                name: aggregate::info::Str::new("CONNECTION_ID_MISMATCH\0"),
1155                id: 3usize,
1156            }
1157            .build(),
1158            aggregate::info::variant::Builder {
1159                name: aggregate::info::Str::new("UNPROTECT_FAILED\0"),
1160                id: 4usize,
1161            }
1162            .build(),
1163            aggregate::info::variant::Builder {
1164                name: aggregate::info::Str::new("DECRYPTION_FAILED\0"),
1165                id: 5usize,
1166            }
1167            .build(),
1168            aggregate::info::variant::Builder {
1169                name: aggregate::info::Str::new("DECODING_FAILED\0"),
1170                id: 6usize,
1171            }
1172            .build(),
1173            aggregate::info::variant::Builder {
1174                name: aggregate::info::Str::new("NON_EMPTY_RETRY_TOKEN\0"),
1175                id: 7usize,
1176            }
1177            .build(),
1178            aggregate::info::variant::Builder {
1179                name: aggregate::info::Str::new("RETRY_DISCARDED\0"),
1180                id: 8usize,
1181            }
1182            .build(),
1183            aggregate::info::variant::Builder {
1184                name: aggregate::info::Str::new("UNDERSIZED_INITIAL_PACKET\0"),
1185                id: 9usize,
1186            }
1187            .build(),
1188            aggregate::info::variant::Builder {
1189                name: aggregate::info::Str::new("INITIAL_CONNECTION_ID_INVALID_SPACE\0"),
1190                id: 10usize,
1191            }
1192            .build(),
1193            aggregate::info::variant::Builder {
1194                name: aggregate::info::Str::new("PACKET_SPACE_DOES_NOT_EXIST\0"),
1195                id: 11usize,
1196            }
1197            .build(),
1198        ];
1199        #[inline]
1200        fn variant_idx(&self) -> usize {
1201            match self {
1202                Self::ConnectionError { .. } => 0usize,
1203                Self::HandshakeNotComplete { .. } => 1usize,
1204                Self::VersionMismatch { .. } => 2usize,
1205                Self::ConnectionIdMismatch { .. } => 3usize,
1206                Self::UnprotectFailed { .. } => 4usize,
1207                Self::DecryptionFailed { .. } => 5usize,
1208                Self::DecodingFailed { .. } => 6usize,
1209                Self::NonEmptyRetryToken { .. } => 7usize,
1210                Self::RetryDiscarded { .. } => 8usize,
1211                Self::UndersizedInitialPacket { .. } => 9usize,
1212                Self::InitialConnectionIdInvalidSpace { .. } => 10usize,
1213                Self::PacketSpaceDoesNotExist { .. } => 11usize,
1214            }
1215        }
1216    }
1217    #[derive(Clone, Debug)]
1218    #[non_exhaustive]
1219    #[deprecated(note = "use on_rx_ack_range_dropped event instead")]
1220    pub enum AckAction {
1221        #[non_exhaustive]
1222        #[doc = " Ack range for received packets was dropped due to space constraints"]
1223        #[doc = ""]
1224        #[doc = " For the purpose of processing Acks, RX packet numbers are stored as"]
1225        #[doc = " packet_number ranges in an IntervalSet; only lower and upper bounds"]
1226        #[doc = " are stored instead of individual packet_numbers. Ranges are merged"]
1227        #[doc = " when possible so only disjointed ranges are stored."]
1228        #[doc = ""]
1229        #[doc = " When at `capacity`, the lowest packet_number range is dropped."]
1230        RxAckRangeDropped {
1231            #[doc = " The packet number range which was dropped"]
1232            packet_number_range: core::ops::RangeInclusive<u64>,
1233            #[doc = " The number of disjoint ranges the IntervalSet can store"]
1234            capacity: usize,
1235            #[doc = " The store packet_number range in the IntervalSet"]
1236            stored_range: core::ops::RangeInclusive<u64>,
1237        },
1238    }
1239    #[allow(deprecated)]
1240    impl aggregate::AsVariant for AckAction {
1241        const VARIANTS: &'static [aggregate::info::Variant] =
1242            &[aggregate::info::variant::Builder {
1243                name: aggregate::info::Str::new("RX_ACK_RANGE_DROPPED\0"),
1244                id: 0usize,
1245            }
1246            .build()];
1247        #[inline]
1248        fn variant_idx(&self) -> usize {
1249            match self {
1250                Self::RxAckRangeDropped { .. } => 0usize,
1251            }
1252        }
1253    }
1254    #[derive(Clone, Debug)]
1255    #[non_exhaustive]
1256    pub enum RetryDiscardReason<'a> {
1257        #[non_exhaustive]
1258        #[doc = " Received a Retry packet with SCID field equal to DCID field."]
1259        ScidEqualsDcid { cid: &'a [u8] },
1260        #[non_exhaustive]
1261        #[doc = " A client only processes at most one Retry packet."]
1262        RetryAlreadyProcessed {},
1263        #[non_exhaustive]
1264        #[doc = " The client discards Retry packets if a valid Initial packet"]
1265        #[doc = " has been received and processed."]
1266        InitialAlreadyProcessed {},
1267        #[non_exhaustive]
1268        #[doc = " The Retry packet received contained an invalid retry integrity tag"]
1269        InvalidIntegrityTag {},
1270    }
1271    impl<'a> aggregate::AsVariant for RetryDiscardReason<'a> {
1272        const VARIANTS: &'static [aggregate::info::Variant] = &[
1273            aggregate::info::variant::Builder {
1274                name: aggregate::info::Str::new("SCID_EQUALS_DCID\0"),
1275                id: 0usize,
1276            }
1277            .build(),
1278            aggregate::info::variant::Builder {
1279                name: aggregate::info::Str::new("RETRY_ALREADY_PROCESSED\0"),
1280                id: 1usize,
1281            }
1282            .build(),
1283            aggregate::info::variant::Builder {
1284                name: aggregate::info::Str::new("INITIAL_ALREADY_PROCESSED\0"),
1285                id: 2usize,
1286            }
1287            .build(),
1288            aggregate::info::variant::Builder {
1289                name: aggregate::info::Str::new("INVALID_INTEGRITY_TAG\0"),
1290                id: 3usize,
1291            }
1292            .build(),
1293        ];
1294        #[inline]
1295        fn variant_idx(&self) -> usize {
1296            match self {
1297                Self::ScidEqualsDcid { .. } => 0usize,
1298                Self::RetryAlreadyProcessed { .. } => 1usize,
1299                Self::InitialAlreadyProcessed { .. } => 2usize,
1300                Self::InvalidIntegrityTag { .. } => 3usize,
1301            }
1302        }
1303    }
1304    #[derive(Clone, Debug)]
1305    #[non_exhaustive]
1306    pub enum MigrationDenyReason {
1307        #[non_exhaustive]
1308        BlockedPort {},
1309        #[non_exhaustive]
1310        PortScopeChanged {},
1311        #[non_exhaustive]
1312        IpScopeChange {},
1313        #[non_exhaustive]
1314        ConnectionMigrationDisabled {},
1315    }
1316    impl aggregate::AsVariant for MigrationDenyReason {
1317        const VARIANTS: &'static [aggregate::info::Variant] = &[
1318            aggregate::info::variant::Builder {
1319                name: aggregate::info::Str::new("BLOCKED_PORT\0"),
1320                id: 0usize,
1321            }
1322            .build(),
1323            aggregate::info::variant::Builder {
1324                name: aggregate::info::Str::new("PORT_SCOPE_CHANGED\0"),
1325                id: 1usize,
1326            }
1327            .build(),
1328            aggregate::info::variant::Builder {
1329                name: aggregate::info::Str::new("IP_SCOPE_CHANGE\0"),
1330                id: 2usize,
1331            }
1332            .build(),
1333            aggregate::info::variant::Builder {
1334                name: aggregate::info::Str::new("CONNECTION_MIGRATION_DISABLED\0"),
1335                id: 3usize,
1336            }
1337            .build(),
1338        ];
1339        #[inline]
1340        fn variant_idx(&self) -> usize {
1341            match self {
1342                Self::BlockedPort { .. } => 0usize,
1343                Self::PortScopeChanged { .. } => 1usize,
1344                Self::IpScopeChange { .. } => 2usize,
1345                Self::ConnectionMigrationDisabled { .. } => 3usize,
1346            }
1347        }
1348    }
1349    #[derive(Clone, Debug)]
1350    #[non_exhaustive]
1351    #[doc = " The current state of the ECN controller for the path"]
1352    pub enum EcnState {
1353        #[non_exhaustive]
1354        #[doc = " ECN capability is being actively tested"]
1355        Testing {},
1356        #[non_exhaustive]
1357        #[doc = " ECN capability has been tested, but not validated yet"]
1358        Unknown {},
1359        #[non_exhaustive]
1360        #[doc = " ECN capability testing has failed validation"]
1361        Failed {},
1362        #[non_exhaustive]
1363        #[doc = " ECN capability has been confirmed"]
1364        Capable {},
1365    }
1366    impl aggregate::AsVariant for EcnState {
1367        const VARIANTS: &'static [aggregate::info::Variant] = &[
1368            aggregate::info::variant::Builder {
1369                name: aggregate::info::Str::new("TESTING\0"),
1370                id: 0usize,
1371            }
1372            .build(),
1373            aggregate::info::variant::Builder {
1374                name: aggregate::info::Str::new("UNKNOWN\0"),
1375                id: 1usize,
1376            }
1377            .build(),
1378            aggregate::info::variant::Builder {
1379                name: aggregate::info::Str::new("FAILED\0"),
1380                id: 2usize,
1381            }
1382            .build(),
1383            aggregate::info::variant::Builder {
1384                name: aggregate::info::Str::new("CAPABLE\0"),
1385                id: 3usize,
1386            }
1387            .build(),
1388        ];
1389        #[inline]
1390        fn variant_idx(&self) -> usize {
1391            match self {
1392                Self::Testing { .. } => 0usize,
1393                Self::Unknown { .. } => 1usize,
1394                Self::Failed { .. } => 2usize,
1395                Self::Capable { .. } => 3usize,
1396            }
1397        }
1398    }
1399    #[derive(Clone, Debug)]
1400    #[non_exhaustive]
1401    #[doc = " Events tracking the progress of handshake status"]
1402    pub enum HandshakeStatus {
1403        #[non_exhaustive]
1404        #[doc = " The handshake has completed."]
1405        Complete {},
1406        #[non_exhaustive]
1407        #[doc = " The handshake has been confirmed."]
1408        Confirmed {},
1409        #[non_exhaustive]
1410        #[doc = " A HANDSHAKE_DONE frame was delivered or received."]
1411        #[doc = ""]
1412        #[doc = " A Client endpoint receives a HANDSHAKE_DONE frame and"]
1413        #[doc = " only a Server is allowed to send the HANDSHAKE_DONE"]
1414        #[doc = " frame."]
1415        HandshakeDoneAcked {},
1416        #[non_exhaustive]
1417        #[doc = " A HANDSHAKE_DONE frame was declared lost."]
1418        #[doc = ""]
1419        #[doc = " The Server is responsible for re-transmitting the"]
1420        #[doc = " HANDSHAKE_DONE frame until it is acked by the peer."]
1421        HandshakeDoneLost {},
1422    }
1423    impl aggregate::AsVariant for HandshakeStatus {
1424        const VARIANTS: &'static [aggregate::info::Variant] = &[
1425            aggregate::info::variant::Builder {
1426                name: aggregate::info::Str::new("COMPLETE\0"),
1427                id: 0usize,
1428            }
1429            .build(),
1430            aggregate::info::variant::Builder {
1431                name: aggregate::info::Str::new("CONFIRMED\0"),
1432                id: 1usize,
1433            }
1434            .build(),
1435            aggregate::info::variant::Builder {
1436                name: aggregate::info::Str::new("HANDSHAKE_DONE_ACKED\0"),
1437                id: 2usize,
1438            }
1439            .build(),
1440            aggregate::info::variant::Builder {
1441                name: aggregate::info::Str::new("HANDSHAKE_DONE_LOST\0"),
1442                id: 3usize,
1443            }
1444            .build(),
1445        ];
1446        #[inline]
1447        fn variant_idx(&self) -> usize {
1448            match self {
1449                Self::Complete { .. } => 0usize,
1450                Self::Confirmed { .. } => 1usize,
1451                Self::HandshakeDoneAcked { .. } => 2usize,
1452                Self::HandshakeDoneLost { .. } => 3usize,
1453            }
1454        }
1455    }
1456    #[derive(Clone, Debug)]
1457    #[non_exhaustive]
1458    #[doc = " The source that caused a congestion event"]
1459    pub enum CongestionSource {
1460        #[non_exhaustive]
1461        #[doc = " Explicit Congestion Notification"]
1462        Ecn {},
1463        #[non_exhaustive]
1464        #[doc = " One or more packets were detected lost"]
1465        PacketLoss {},
1466    }
1467    impl aggregate::AsVariant for CongestionSource {
1468        const VARIANTS: &'static [aggregate::info::Variant] = &[
1469            aggregate::info::variant::Builder {
1470                name: aggregate::info::Str::new("ECN\0"),
1471                id: 0usize,
1472            }
1473            .build(),
1474            aggregate::info::variant::Builder {
1475                name: aggregate::info::Str::new("PACKET_LOSS\0"),
1476                id: 1usize,
1477            }
1478            .build(),
1479        ];
1480        #[inline]
1481        fn variant_idx(&self) -> usize {
1482            match self {
1483                Self::Ecn { .. } => 0usize,
1484                Self::PacketLoss { .. } => 1usize,
1485            }
1486        }
1487    }
1488    #[non_exhaustive]
1489    #[derive(Copy, Clone, Debug, Eq, PartialEq)]
1490    #[allow(non_camel_case_types)]
1491    pub enum CipherSuite {
1492        #[non_exhaustive]
1493        TLS_AES_128_GCM_SHA256 {},
1494        #[non_exhaustive]
1495        TLS_AES_256_GCM_SHA384 {},
1496        #[non_exhaustive]
1497        TLS_CHACHA20_POLY1305_SHA256 {},
1498        #[non_exhaustive]
1499        Unknown {},
1500    }
1501    impl aggregate::AsVariant for CipherSuite {
1502        const VARIANTS: &'static [aggregate::info::Variant] = &[
1503            aggregate::info::variant::Builder {
1504                name: aggregate::info::Str::new("TLS_AES_128_GCM_SHA256\0"),
1505                id: 0usize,
1506            }
1507            .build(),
1508            aggregate::info::variant::Builder {
1509                name: aggregate::info::Str::new("TLS_AES_256_GCM_SHA384\0"),
1510                id: 1usize,
1511            }
1512            .build(),
1513            aggregate::info::variant::Builder {
1514                name: aggregate::info::Str::new("TLS_CHACHA20_POLY1305_SHA256\0"),
1515                id: 2usize,
1516            }
1517            .build(),
1518            aggregate::info::variant::Builder {
1519                name: aggregate::info::Str::new("UNKNOWN\0"),
1520                id: 3usize,
1521            }
1522            .build(),
1523        ];
1524        #[inline]
1525        fn variant_idx(&self) -> usize {
1526            match self {
1527                Self::TLS_AES_128_GCM_SHA256 { .. } => 0usize,
1528                Self::TLS_AES_256_GCM_SHA384 { .. } => 1usize,
1529                Self::TLS_CHACHA20_POLY1305_SHA256 { .. } => 2usize,
1530                Self::Unknown { .. } => 3usize,
1531            }
1532        }
1533    }
1534    #[derive(Clone, Debug)]
1535    #[non_exhaustive]
1536    pub enum PathChallengeStatus {
1537        #[non_exhaustive]
1538        Validated {},
1539        #[non_exhaustive]
1540        Abandoned {},
1541    }
1542    impl aggregate::AsVariant for PathChallengeStatus {
1543        const VARIANTS: &'static [aggregate::info::Variant] = &[
1544            aggregate::info::variant::Builder {
1545                name: aggregate::info::Str::new("VALIDATED\0"),
1546                id: 0usize,
1547            }
1548            .build(),
1549            aggregate::info::variant::Builder {
1550                name: aggregate::info::Str::new("ABANDONED\0"),
1551                id: 1usize,
1552            }
1553            .build(),
1554        ];
1555        #[inline]
1556        fn variant_idx(&self) -> usize {
1557            match self {
1558                Self::Validated { .. } => 0usize,
1559                Self::Abandoned { .. } => 1usize,
1560            }
1561        }
1562    }
1563    #[derive(Clone, Debug)]
1564    #[non_exhaustive]
1565    #[doc = " The reason the slow start congestion controller state has been exited"]
1566    pub enum SlowStartExitCause {
1567        #[non_exhaustive]
1568        #[doc = " A packet was determined lost"]
1569        PacketLoss {},
1570        #[non_exhaustive]
1571        #[doc = " An Explicit Congestion Notification: Congestion Experienced marking was received"]
1572        Ecn {},
1573        #[non_exhaustive]
1574        #[doc = " The round trip time estimate was updated"]
1575        Rtt {},
1576        #[non_exhaustive]
1577        #[doc = " Slow Start exited due to a reason other than those above"]
1578        #[doc = ""]
1579        #[doc = " With the Cubic congestion controller, this reason is used after the initial exiting of"]
1580        #[doc = " Slow Start, when the previously determined Slow Start threshold is exceed by the"]
1581        #[doc = " congestion window."]
1582        Other {},
1583    }
1584    impl aggregate::AsVariant for SlowStartExitCause {
1585        const VARIANTS: &'static [aggregate::info::Variant] = &[
1586            aggregate::info::variant::Builder {
1587                name: aggregate::info::Str::new("PACKET_LOSS\0"),
1588                id: 0usize,
1589            }
1590            .build(),
1591            aggregate::info::variant::Builder {
1592                name: aggregate::info::Str::new("ECN\0"),
1593                id: 1usize,
1594            }
1595            .build(),
1596            aggregate::info::variant::Builder {
1597                name: aggregate::info::Str::new("RTT\0"),
1598                id: 2usize,
1599            }
1600            .build(),
1601            aggregate::info::variant::Builder {
1602                name: aggregate::info::Str::new("OTHER\0"),
1603                id: 3usize,
1604            }
1605            .build(),
1606        ];
1607        #[inline]
1608        fn variant_idx(&self) -> usize {
1609            match self {
1610                Self::PacketLoss { .. } => 0usize,
1611                Self::Ecn { .. } => 1usize,
1612                Self::Rtt { .. } => 2usize,
1613                Self::Other { .. } => 3usize,
1614            }
1615        }
1616    }
1617    #[derive(Clone, Debug)]
1618    #[non_exhaustive]
1619    #[doc = " The reason the MTU was updated"]
1620    pub enum MtuUpdatedCause {
1621        #[non_exhaustive]
1622        #[doc = " The MTU was initialized with the default value"]
1623        NewPath {},
1624        #[non_exhaustive]
1625        #[doc = " An MTU probe was acknowledged by the peer"]
1626        ProbeAcknowledged {},
1627        #[non_exhaustive]
1628        #[doc = " A blackhole was detected"]
1629        Blackhole {},
1630        #[non_exhaustive]
1631        #[doc = " An early packet using the configured InitialMtu was lost"]
1632        InitialMtuPacketLost {},
1633        #[non_exhaustive]
1634        #[doc = " An early packet using the configured InitialMtu was acknowledged by the peer"]
1635        InitialMtuPacketAcknowledged {},
1636        #[non_exhaustive]
1637        #[doc = " MTU probes larger than the current MTU were not acknowledged"]
1638        LargerProbesLost {},
1639    }
1640    impl aggregate::AsVariant for MtuUpdatedCause {
1641        const VARIANTS: &'static [aggregate::info::Variant] = &[
1642            aggregate::info::variant::Builder {
1643                name: aggregate::info::Str::new("NEW_PATH\0"),
1644                id: 0usize,
1645            }
1646            .build(),
1647            aggregate::info::variant::Builder {
1648                name: aggregate::info::Str::new("PROBE_ACKNOWLEDGED\0"),
1649                id: 1usize,
1650            }
1651            .build(),
1652            aggregate::info::variant::Builder {
1653                name: aggregate::info::Str::new("BLACKHOLE\0"),
1654                id: 2usize,
1655            }
1656            .build(),
1657            aggregate::info::variant::Builder {
1658                name: aggregate::info::Str::new("INITIAL_MTU_PACKET_LOST\0"),
1659                id: 3usize,
1660            }
1661            .build(),
1662            aggregate::info::variant::Builder {
1663                name: aggregate::info::Str::new("INITIAL_MTU_PACKET_ACKNOWLEDGED\0"),
1664                id: 4usize,
1665            }
1666            .build(),
1667            aggregate::info::variant::Builder {
1668                name: aggregate::info::Str::new("LARGER_PROBES_LOST\0"),
1669                id: 5usize,
1670            }
1671            .build(),
1672        ];
1673        #[inline]
1674        fn variant_idx(&self) -> usize {
1675            match self {
1676                Self::NewPath { .. } => 0usize,
1677                Self::ProbeAcknowledged { .. } => 1usize,
1678                Self::Blackhole { .. } => 2usize,
1679                Self::InitialMtuPacketLost { .. } => 3usize,
1680                Self::InitialMtuPacketAcknowledged { .. } => 4usize,
1681                Self::LargerProbesLost { .. } => 5usize,
1682            }
1683        }
1684    }
1685    #[derive(Clone, Debug)]
1686    #[non_exhaustive]
1687    pub enum BbrState {
1688        #[non_exhaustive]
1689        Startup {},
1690        #[non_exhaustive]
1691        Drain {},
1692        #[non_exhaustive]
1693        ProbeBwDown {},
1694        #[non_exhaustive]
1695        ProbeBwCruise {},
1696        #[non_exhaustive]
1697        ProbeBwRefill {},
1698        #[non_exhaustive]
1699        ProbeBwUp {},
1700        #[non_exhaustive]
1701        ProbeRtt {},
1702    }
1703    impl aggregate::AsVariant for BbrState {
1704        const VARIANTS: &'static [aggregate::info::Variant] = &[
1705            aggregate::info::variant::Builder {
1706                name: aggregate::info::Str::new("STARTUP\0"),
1707                id: 0usize,
1708            }
1709            .build(),
1710            aggregate::info::variant::Builder {
1711                name: aggregate::info::Str::new("DRAIN\0"),
1712                id: 1usize,
1713            }
1714            .build(),
1715            aggregate::info::variant::Builder {
1716                name: aggregate::info::Str::new("PROBE_BW_DOWN\0"),
1717                id: 2usize,
1718            }
1719            .build(),
1720            aggregate::info::variant::Builder {
1721                name: aggregate::info::Str::new("PROBE_BW_CRUISE\0"),
1722                id: 3usize,
1723            }
1724            .build(),
1725            aggregate::info::variant::Builder {
1726                name: aggregate::info::Str::new("PROBE_BW_REFILL\0"),
1727                id: 4usize,
1728            }
1729            .build(),
1730            aggregate::info::variant::Builder {
1731                name: aggregate::info::Str::new("PROBE_BW_UP\0"),
1732                id: 5usize,
1733            }
1734            .build(),
1735            aggregate::info::variant::Builder {
1736                name: aggregate::info::Str::new("PROBE_RTT\0"),
1737                id: 6usize,
1738            }
1739            .build(),
1740        ];
1741        #[inline]
1742        fn variant_idx(&self) -> usize {
1743            match self {
1744                Self::Startup { .. } => 0usize,
1745                Self::Drain { .. } => 1usize,
1746                Self::ProbeBwDown { .. } => 2usize,
1747                Self::ProbeBwCruise { .. } => 3usize,
1748                Self::ProbeBwRefill { .. } => 4usize,
1749                Self::ProbeBwUp { .. } => 5usize,
1750                Self::ProbeRtt { .. } => 6usize,
1751            }
1752        }
1753    }
1754    #[derive(Clone, Debug)]
1755    #[non_exhaustive]
1756    pub enum DcState {
1757        #[non_exhaustive]
1758        VersionNegotiated { version: u32 },
1759        #[non_exhaustive]
1760        NoVersionNegotiated {},
1761        #[non_exhaustive]
1762        PathSecretsReady {},
1763        #[non_exhaustive]
1764        Complete {},
1765    }
1766    impl aggregate::AsVariant for DcState {
1767        const VARIANTS: &'static [aggregate::info::Variant] = &[
1768            aggregate::info::variant::Builder {
1769                name: aggregate::info::Str::new("VERSION_NEGOTIATED\0"),
1770                id: 0usize,
1771            }
1772            .build(),
1773            aggregate::info::variant::Builder {
1774                name: aggregate::info::Str::new("NO_VERSION_NEGOTIATED\0"),
1775                id: 1usize,
1776            }
1777            .build(),
1778            aggregate::info::variant::Builder {
1779                name: aggregate::info::Str::new("PATH_SECRETS_READY\0"),
1780                id: 2usize,
1781            }
1782            .build(),
1783            aggregate::info::variant::Builder {
1784                name: aggregate::info::Str::new("COMPLETE\0"),
1785                id: 3usize,
1786            }
1787            .build(),
1788        ];
1789        #[inline]
1790        fn variant_idx(&self) -> usize {
1791            match self {
1792                Self::VersionNegotiated { .. } => 0usize,
1793                Self::NoVersionNegotiated { .. } => 1usize,
1794                Self::PathSecretsReady { .. } => 2usize,
1795                Self::Complete { .. } => 3usize,
1796            }
1797        }
1798    }
1799    #[derive(Clone, Debug)]
1800    #[non_exhaustive]
1801    #[doc = " Application level protocol"]
1802    pub struct ApplicationProtocolInformation<'a> {
1803        pub chosen_application_protocol: &'a [u8],
1804    }
1805    #[cfg(any(test, feature = "testing"))]
1806    impl<'a> crate::event::snapshot::Fmt for ApplicationProtocolInformation<'a> {
1807        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
1808            let mut fmt = fmt.debug_struct("ApplicationProtocolInformation");
1809            fmt.field(
1810                "chosen_application_protocol",
1811                &self.chosen_application_protocol,
1812            );
1813            fmt.finish()
1814        }
1815    }
1816    impl<'a> Event for ApplicationProtocolInformation<'a> {
1817        const NAME: &'static str = "transport:application_protocol_information";
1818    }
1819    #[derive(Clone, Debug)]
1820    #[non_exhaustive]
1821    #[doc = " Server Name was negotiated for the connection"]
1822    pub struct ServerNameInformation<'a> {
1823        pub chosen_server_name: &'a str,
1824    }
1825    #[cfg(any(test, feature = "testing"))]
1826    impl<'a> crate::event::snapshot::Fmt for ServerNameInformation<'a> {
1827        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
1828            let mut fmt = fmt.debug_struct("ServerNameInformation");
1829            fmt.field("chosen_server_name", &self.chosen_server_name);
1830            fmt.finish()
1831        }
1832    }
1833    impl<'a> Event for ServerNameInformation<'a> {
1834        const NAME: &'static str = "transport:server_name_information";
1835    }
1836    #[derive(Clone, Debug)]
1837    #[non_exhaustive]
1838    #[doc = " Key Exchange Group was negotiated for the connection"]
1839    #[doc = ""]
1840    #[doc = " `contains_kem` is `true` if the `chosen_group_name`"]
1841    #[doc = " contains a key encapsulation mechanism"]
1842    pub struct KeyExchangeGroup<'a> {
1843        pub chosen_group_name: &'a str,
1844        pub contains_kem: bool,
1845    }
1846    #[cfg(any(test, feature = "testing"))]
1847    impl<'a> crate::event::snapshot::Fmt for KeyExchangeGroup<'a> {
1848        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
1849            let mut fmt = fmt.debug_struct("KeyExchangeGroup");
1850            fmt.field("chosen_group_name", &self.chosen_group_name);
1851            fmt.field("contains_kem", &self.contains_kem);
1852            fmt.finish()
1853        }
1854    }
1855    impl<'a> Event for KeyExchangeGroup<'a> {
1856        const NAME: &'static str = "transport:key_exchange_group";
1857    }
1858    #[derive(Clone, Debug)]
1859    #[non_exhaustive]
1860    #[doc = " Packet was skipped with a given reason"]
1861    pub struct PacketSkipped {
1862        pub number: u64,
1863        pub space: KeySpace,
1864        pub reason: PacketSkipReason,
1865    }
1866    #[cfg(any(test, feature = "testing"))]
1867    impl crate::event::snapshot::Fmt for PacketSkipped {
1868        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
1869            let mut fmt = fmt.debug_struct("PacketSkipped");
1870            fmt.field("number", &self.number);
1871            fmt.field("space", &self.space);
1872            fmt.field("reason", &self.reason);
1873            fmt.finish()
1874        }
1875    }
1876    impl Event for PacketSkipped {
1877        const NAME: &'static str = "transport:packet_skipped";
1878    }
1879    #[derive(Clone, Debug)]
1880    #[non_exhaustive]
1881    #[doc = " Packet was sent by a connection"]
1882    pub struct PacketSent {
1883        pub packet_header: PacketHeader,
1884        pub packet_len: usize,
1885    }
1886    #[cfg(any(test, feature = "testing"))]
1887    impl crate::event::snapshot::Fmt for PacketSent {
1888        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
1889            let mut fmt = fmt.debug_struct("PacketSent");
1890            fmt.field("packet_header", &self.packet_header);
1891            fmt.field("packet_len", &self.packet_len);
1892            fmt.finish()
1893        }
1894    }
1895    impl Event for PacketSent {
1896        const NAME: &'static str = "transport:packet_sent";
1897    }
1898    #[derive(Clone, Debug)]
1899    #[non_exhaustive]
1900    #[doc = " Packet was received by a connection"]
1901    pub struct PacketReceived {
1902        pub packet_header: PacketHeader,
1903    }
1904    #[cfg(any(test, feature = "testing"))]
1905    impl crate::event::snapshot::Fmt for PacketReceived {
1906        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
1907            let mut fmt = fmt.debug_struct("PacketReceived");
1908            fmt.field("packet_header", &self.packet_header);
1909            fmt.finish()
1910        }
1911    }
1912    impl Event for PacketReceived {
1913        const NAME: &'static str = "transport:packet_received";
1914    }
1915    #[derive(Clone, Debug)]
1916    #[non_exhaustive]
1917    #[doc = " Active path was updated"]
1918    pub struct ActivePathUpdated<'a> {
1919        pub previous: Path<'a>,
1920        pub active: Path<'a>,
1921    }
1922    #[cfg(any(test, feature = "testing"))]
1923    impl<'a> crate::event::snapshot::Fmt for ActivePathUpdated<'a> {
1924        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
1925            let mut fmt = fmt.debug_struct("ActivePathUpdated");
1926            fmt.field("previous", &self.previous);
1927            fmt.field("active", &self.active);
1928            fmt.finish()
1929        }
1930    }
1931    impl<'a> Event for ActivePathUpdated<'a> {
1932        const NAME: &'static str = "connectivity:active_path_updated";
1933    }
1934    #[derive(Clone, Debug)]
1935    #[non_exhaustive]
1936    #[doc = " A new path was created"]
1937    pub struct PathCreated<'a> {
1938        pub active: Path<'a>,
1939        pub new: Path<'a>,
1940    }
1941    #[cfg(any(test, feature = "testing"))]
1942    impl<'a> crate::event::snapshot::Fmt for PathCreated<'a> {
1943        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
1944            let mut fmt = fmt.debug_struct("PathCreated");
1945            fmt.field("active", &self.active);
1946            fmt.field("new", &self.new);
1947            fmt.finish()
1948        }
1949    }
1950    impl<'a> Event for PathCreated<'a> {
1951        const NAME: &'static str = "transport:path_created";
1952    }
1953    #[derive(Clone, Debug)]
1954    #[non_exhaustive]
1955    #[doc = " Frame was sent"]
1956    pub struct FrameSent {
1957        pub packet_header: PacketHeader,
1958        pub path_id: u64,
1959        pub frame: Frame,
1960    }
1961    #[cfg(any(test, feature = "testing"))]
1962    impl crate::event::snapshot::Fmt for FrameSent {
1963        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
1964            let mut fmt = fmt.debug_struct("FrameSent");
1965            fmt.field("packet_header", &self.packet_header);
1966            fmt.field("path_id", &self.path_id);
1967            fmt.field("frame", &self.frame);
1968            fmt.finish()
1969        }
1970    }
1971    impl Event for FrameSent {
1972        const NAME: &'static str = "transport:frame_sent";
1973    }
1974    #[derive(Clone, Debug)]
1975    #[non_exhaustive]
1976    #[doc = " Frame was received"]
1977    pub struct FrameReceived<'a> {
1978        pub packet_header: PacketHeader,
1979        pub path: Path<'a>,
1980        pub frame: Frame,
1981    }
1982    #[cfg(any(test, feature = "testing"))]
1983    impl<'a> crate::event::snapshot::Fmt for FrameReceived<'a> {
1984        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
1985            let mut fmt = fmt.debug_struct("FrameReceived");
1986            fmt.field("packet_header", &self.packet_header);
1987            fmt.field("path", &self.path);
1988            fmt.field("frame", &self.frame);
1989            fmt.finish()
1990        }
1991    }
1992    impl<'a> Event for FrameReceived<'a> {
1993        const NAME: &'static str = "transport:frame_received";
1994    }
1995    #[derive(Clone, Debug)]
1996    #[non_exhaustive]
1997    #[doc = " A `CONNECTION_CLOSE` frame was received"]
1998    #[doc = ""]
1999    #[doc = " This event includes additional details from the frame, particularly the"]
2000    #[doc = " reason (if provided) the peer closed the connection"]
2001    pub struct ConnectionCloseFrameReceived<'a> {
2002        pub packet_header: PacketHeader,
2003        pub path: Path<'a>,
2004        pub frame: ConnectionCloseFrame<'a>,
2005    }
2006    #[cfg(any(test, feature = "testing"))]
2007    impl<'a> crate::event::snapshot::Fmt for ConnectionCloseFrameReceived<'a> {
2008        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2009            let mut fmt = fmt.debug_struct("ConnectionCloseFrameReceived");
2010            fmt.field("packet_header", &self.packet_header);
2011            fmt.field("path", &self.path);
2012            fmt.field("frame", &self.frame);
2013            fmt.finish()
2014        }
2015    }
2016    impl<'a> Event for ConnectionCloseFrameReceived<'a> {
2017        const NAME: &'static str = "transport:connection_close_frame_received";
2018    }
2019    #[derive(Clone, Debug)]
2020    #[non_exhaustive]
2021    #[doc = " Packet was lost"]
2022    pub struct PacketLost<'a> {
2023        pub packet_header: PacketHeader,
2024        pub path: Path<'a>,
2025        pub bytes_lost: u16,
2026        pub is_mtu_probe: bool,
2027    }
2028    #[cfg(any(test, feature = "testing"))]
2029    impl<'a> crate::event::snapshot::Fmt for PacketLost<'a> {
2030        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2031            let mut fmt = fmt.debug_struct("PacketLost");
2032            fmt.field("packet_header", &self.packet_header);
2033            fmt.field("path", &self.path);
2034            fmt.field("bytes_lost", &self.bytes_lost);
2035            fmt.field("is_mtu_probe", &self.is_mtu_probe);
2036            fmt.finish()
2037        }
2038    }
2039    impl<'a> Event for PacketLost<'a> {
2040        const NAME: &'static str = "recovery:packet_lost";
2041    }
2042    #[derive(Clone, Debug)]
2043    #[non_exhaustive]
2044    #[doc = " Recovery metrics updated"]
2045    pub struct RecoveryMetrics<'a> {
2046        pub path: Path<'a>,
2047        pub min_rtt: Duration,
2048        pub smoothed_rtt: Duration,
2049        pub latest_rtt: Duration,
2050        pub rtt_variance: Duration,
2051        pub max_ack_delay: Duration,
2052        pub pto_count: u32,
2053        pub congestion_window: u32,
2054        pub bytes_in_flight: u32,
2055        pub congestion_limited: bool,
2056    }
2057    #[cfg(any(test, feature = "testing"))]
2058    impl<'a> crate::event::snapshot::Fmt for RecoveryMetrics<'a> {
2059        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2060            let mut fmt = fmt.debug_struct("RecoveryMetrics");
2061            fmt.field("path", &self.path);
2062            fmt.field("min_rtt", &self.min_rtt);
2063            fmt.field("smoothed_rtt", &self.smoothed_rtt);
2064            fmt.field("latest_rtt", &self.latest_rtt);
2065            fmt.field("rtt_variance", &self.rtt_variance);
2066            fmt.field("max_ack_delay", &self.max_ack_delay);
2067            fmt.field("pto_count", &self.pto_count);
2068            fmt.field("congestion_window", &self.congestion_window);
2069            fmt.field("bytes_in_flight", &self.bytes_in_flight);
2070            fmt.field("congestion_limited", &self.congestion_limited);
2071            fmt.finish()
2072        }
2073    }
2074    impl<'a> Event for RecoveryMetrics<'a> {
2075        const NAME: &'static str = "recovery:metrics_updated";
2076    }
2077    #[derive(Clone, Debug)]
2078    #[non_exhaustive]
2079    #[doc = " Congestion (ECN or packet loss) has occurred"]
2080    pub struct Congestion<'a> {
2081        pub path: Path<'a>,
2082        pub source: CongestionSource,
2083    }
2084    #[cfg(any(test, feature = "testing"))]
2085    impl<'a> crate::event::snapshot::Fmt for Congestion<'a> {
2086        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2087            let mut fmt = fmt.debug_struct("Congestion");
2088            fmt.field("path", &self.path);
2089            fmt.field("source", &self.source);
2090            fmt.finish()
2091        }
2092    }
2093    impl<'a> Event for Congestion<'a> {
2094        const NAME: &'static str = "recovery:congestion";
2095    }
2096    #[derive(Clone, Debug)]
2097    #[non_exhaustive]
2098    #[doc = " Events related to ACK processing"]
2099    #[deprecated(note = "use on_rx_ack_range_dropped event instead")]
2100    #[allow(deprecated)]
2101    pub struct AckProcessed<'a> {
2102        pub action: AckAction,
2103        pub path: Path<'a>,
2104    }
2105    #[cfg(any(test, feature = "testing"))]
2106    #[allow(deprecated)]
2107    impl<'a> crate::event::snapshot::Fmt for AckProcessed<'a> {
2108        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2109            let mut fmt = fmt.debug_struct("AckProcessed");
2110            fmt.field("action", &self.action);
2111            fmt.field("path", &self.path);
2112            fmt.finish()
2113        }
2114    }
2115    #[allow(deprecated)]
2116    impl<'a> Event for AckProcessed<'a> {
2117        const NAME: &'static str = "recovery:ack_processed";
2118    }
2119    #[derive(Clone, Debug)]
2120    #[non_exhaustive]
2121    #[doc = " Ack range for received packets was dropped due to space constraints"]
2122    #[doc = ""]
2123    #[doc = " For the purpose of processing Acks, RX packet numbers are stored as"]
2124    #[doc = " packet_number ranges in an IntervalSet; only lower and upper bounds"]
2125    #[doc = " are stored instead of individual packet_numbers. Ranges are merged"]
2126    #[doc = " when possible so only disjointed ranges are stored."]
2127    #[doc = ""]
2128    #[doc = " When at `capacity`, the lowest packet_number range is dropped."]
2129    pub struct RxAckRangeDropped<'a> {
2130        pub path: Path<'a>,
2131        #[doc = " The packet number range which was dropped"]
2132        pub packet_number_range: core::ops::RangeInclusive<u64>,
2133        #[doc = " The number of disjoint ranges the IntervalSet can store"]
2134        pub capacity: usize,
2135        #[doc = " The store packet_number range in the IntervalSet"]
2136        pub stored_range: core::ops::RangeInclusive<u64>,
2137    }
2138    #[cfg(any(test, feature = "testing"))]
2139    impl<'a> crate::event::snapshot::Fmt for RxAckRangeDropped<'a> {
2140        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2141            let mut fmt = fmt.debug_struct("RxAckRangeDropped");
2142            fmt.field("path", &self.path);
2143            fmt.field("packet_number_range", &self.packet_number_range);
2144            fmt.field("capacity", &self.capacity);
2145            fmt.field("stored_range", &self.stored_range);
2146            fmt.finish()
2147        }
2148    }
2149    impl<'a> Event for RxAckRangeDropped<'a> {
2150        const NAME: &'static str = "recovery:rx_ack_range_dropped";
2151    }
2152    #[derive(Clone, Debug)]
2153    #[non_exhaustive]
2154    #[doc = " ACK range was received"]
2155    pub struct AckRangeReceived<'a> {
2156        pub packet_header: PacketHeader,
2157        pub path: Path<'a>,
2158        pub ack_range: RangeInclusive<u64>,
2159    }
2160    #[cfg(any(test, feature = "testing"))]
2161    impl<'a> crate::event::snapshot::Fmt for AckRangeReceived<'a> {
2162        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2163            let mut fmt = fmt.debug_struct("AckRangeReceived");
2164            fmt.field("packet_header", &self.packet_header);
2165            fmt.field("path", &self.path);
2166            fmt.field("ack_range", &self.ack_range);
2167            fmt.finish()
2168        }
2169    }
2170    impl<'a> Event for AckRangeReceived<'a> {
2171        const NAME: &'static str = "recovery:ack_range_received";
2172    }
2173    #[derive(Clone, Debug)]
2174    #[non_exhaustive]
2175    #[doc = " ACK range was sent"]
2176    pub struct AckRangeSent {
2177        pub packet_header: PacketHeader,
2178        pub path_id: u64,
2179        pub ack_range: RangeInclusive<u64>,
2180    }
2181    #[cfg(any(test, feature = "testing"))]
2182    impl crate::event::snapshot::Fmt for AckRangeSent {
2183        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2184            let mut fmt = fmt.debug_struct("AckRangeSent");
2185            fmt.field("packet_header", &self.packet_header);
2186            fmt.field("path_id", &self.path_id);
2187            fmt.field("ack_range", &self.ack_range);
2188            fmt.finish()
2189        }
2190    }
2191    impl Event for AckRangeSent {
2192        const NAME: &'static str = "recovery:ack_range_sent";
2193    }
2194    #[derive(Clone, Debug)]
2195    #[non_exhaustive]
2196    #[doc = " Packet was dropped with the given reason"]
2197    pub struct PacketDropped<'a> {
2198        pub reason: PacketDropReason<'a>,
2199    }
2200    #[cfg(any(test, feature = "testing"))]
2201    impl<'a> crate::event::snapshot::Fmt for PacketDropped<'a> {
2202        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2203            let mut fmt = fmt.debug_struct("PacketDropped");
2204            fmt.field("reason", &self.reason);
2205            fmt.finish()
2206        }
2207    }
2208    impl<'a> Event for PacketDropped<'a> {
2209        const NAME: &'static str = "transport:packet_dropped";
2210    }
2211    #[derive(Clone, Debug)]
2212    #[non_exhaustive]
2213    #[doc = " Crypto key updated"]
2214    pub struct KeyUpdate {
2215        pub key_type: KeyType,
2216        pub cipher_suite: CipherSuite,
2217    }
2218    #[cfg(any(test, feature = "testing"))]
2219    impl crate::event::snapshot::Fmt for KeyUpdate {
2220        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2221            let mut fmt = fmt.debug_struct("KeyUpdate");
2222            fmt.field("key_type", &self.key_type);
2223            fmt.field("cipher_suite", &self.cipher_suite);
2224            fmt.finish()
2225        }
2226    }
2227    impl Event for KeyUpdate {
2228        const NAME: &'static str = "security:key_update";
2229    }
2230    #[derive(Clone, Debug)]
2231    #[non_exhaustive]
2232    pub struct KeySpaceDiscarded {
2233        pub space: KeySpace,
2234    }
2235    #[cfg(any(test, feature = "testing"))]
2236    impl crate::event::snapshot::Fmt for KeySpaceDiscarded {
2237        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2238            let mut fmt = fmt.debug_struct("KeySpaceDiscarded");
2239            fmt.field("space", &self.space);
2240            fmt.finish()
2241        }
2242    }
2243    impl Event for KeySpaceDiscarded {
2244        const NAME: &'static str = "security:key_space_discarded";
2245    }
2246    #[derive(Clone, Debug)]
2247    #[non_exhaustive]
2248    #[doc = " Connection started"]
2249    pub struct ConnectionStarted<'a> {
2250        pub path: Path<'a>,
2251    }
2252    #[cfg(any(test, feature = "testing"))]
2253    impl<'a> crate::event::snapshot::Fmt for ConnectionStarted<'a> {
2254        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2255            let mut fmt = fmt.debug_struct("ConnectionStarted");
2256            fmt.field("path", &self.path);
2257            fmt.finish()
2258        }
2259    }
2260    impl<'a> Event for ConnectionStarted<'a> {
2261        const NAME: &'static str = "connectivity:connection_started";
2262    }
2263    #[derive(Clone, Debug)]
2264    #[non_exhaustive]
2265    #[doc = " Duplicate packet received"]
2266    pub struct DuplicatePacket<'a> {
2267        pub packet_header: PacketHeader,
2268        pub path: Path<'a>,
2269        pub error: DuplicatePacketError,
2270    }
2271    #[cfg(any(test, feature = "testing"))]
2272    impl<'a> crate::event::snapshot::Fmt for DuplicatePacket<'a> {
2273        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2274            let mut fmt = fmt.debug_struct("DuplicatePacket");
2275            fmt.field("packet_header", &self.packet_header);
2276            fmt.field("path", &self.path);
2277            fmt.field("error", &self.error);
2278            fmt.finish()
2279        }
2280    }
2281    impl<'a> Event for DuplicatePacket<'a> {
2282        const NAME: &'static str = "transport:duplicate_packet";
2283    }
2284    #[derive(Clone, Debug)]
2285    #[non_exhaustive]
2286    #[doc = " Transport parameters received by connection"]
2287    pub struct TransportParametersReceived<'a> {
2288        pub transport_parameters: TransportParameters<'a>,
2289    }
2290    #[cfg(any(test, feature = "testing"))]
2291    impl<'a> crate::event::snapshot::Fmt for TransportParametersReceived<'a> {
2292        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2293            let mut fmt = fmt.debug_struct("TransportParametersReceived");
2294            fmt.field("transport_parameters", &self.transport_parameters);
2295            fmt.finish()
2296        }
2297    }
2298    impl<'a> Event for TransportParametersReceived<'a> {
2299        const NAME: &'static str = "transport:transport_parameters_received";
2300    }
2301    #[derive(Clone, Debug)]
2302    #[non_exhaustive]
2303    #[doc = " Datagram sent by a connection"]
2304    pub struct DatagramSent {
2305        pub len: u16,
2306        #[doc = " The GSO offset at which this datagram was written"]
2307        #[doc = ""]
2308        #[doc = " If this value is greater than 0, it indicates that this datagram has been sent with other"]
2309        #[doc = " segments in a single buffer."]
2310        #[doc = ""]
2311        #[doc = " See the [Linux kernel documentation](https://www.kernel.org/doc/html/latest/networking/segmentation-offloads.html#generic-segmentation-offload) for more details."]
2312        pub gso_offset: usize,
2313    }
2314    #[cfg(any(test, feature = "testing"))]
2315    impl crate::event::snapshot::Fmt for DatagramSent {
2316        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2317            let mut fmt = fmt.debug_struct("DatagramSent");
2318            fmt.field("len", &self.len);
2319            fmt.field("gso_offset", &self.gso_offset);
2320            fmt.finish()
2321        }
2322    }
2323    impl Event for DatagramSent {
2324        const NAME: &'static str = "transport:datagram_sent";
2325    }
2326    #[derive(Clone, Debug)]
2327    #[non_exhaustive]
2328    #[doc = " Datagram received by a connection"]
2329    pub struct DatagramReceived {
2330        pub len: u16,
2331    }
2332    #[cfg(any(test, feature = "testing"))]
2333    impl crate::event::snapshot::Fmt for DatagramReceived {
2334        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2335            let mut fmt = fmt.debug_struct("DatagramReceived");
2336            fmt.field("len", &self.len);
2337            fmt.finish()
2338        }
2339    }
2340    impl Event for DatagramReceived {
2341        const NAME: &'static str = "transport:datagram_received";
2342    }
2343    #[derive(Clone, Debug)]
2344    #[non_exhaustive]
2345    #[doc = " Datagram dropped by a connection"]
2346    pub struct DatagramDropped<'a> {
2347        pub local_addr: SocketAddress<'a>,
2348        pub remote_addr: SocketAddress<'a>,
2349        pub destination_cid: ConnectionId<'a>,
2350        pub source_cid: Option<ConnectionId<'a>>,
2351        pub len: u16,
2352        pub reason: DatagramDropReason,
2353    }
2354    #[cfg(any(test, feature = "testing"))]
2355    impl<'a> crate::event::snapshot::Fmt for DatagramDropped<'a> {
2356        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2357            let mut fmt = fmt.debug_struct("DatagramDropped");
2358            fmt.field("local_addr", &self.local_addr);
2359            fmt.field("remote_addr", &self.remote_addr);
2360            fmt.field("destination_cid", &self.destination_cid);
2361            fmt.field("source_cid", &self.source_cid);
2362            fmt.field("len", &self.len);
2363            fmt.field("reason", &self.reason);
2364            fmt.finish()
2365        }
2366    }
2367    impl<'a> Event for DatagramDropped<'a> {
2368        const NAME: &'static str = "transport:datagram_dropped";
2369    }
2370    #[derive(Clone, Debug)]
2371    #[non_exhaustive]
2372    #[doc = " The remote address was changed before the handshake was complete"]
2373    pub struct HandshakeRemoteAddressChangeObserved<'a> {
2374        pub local_addr: SocketAddress<'a>,
2375        #[doc = " The newly observed remote address"]
2376        pub remote_addr: SocketAddress<'a>,
2377        #[doc = " The remote address established from the initial packet"]
2378        pub initial_remote_addr: SocketAddress<'a>,
2379    }
2380    #[cfg(any(test, feature = "testing"))]
2381    impl<'a> crate::event::snapshot::Fmt for HandshakeRemoteAddressChangeObserved<'a> {
2382        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2383            let mut fmt = fmt.debug_struct("HandshakeRemoteAddressChangeObserved");
2384            fmt.field("local_addr", &self.local_addr);
2385            fmt.field("remote_addr", &self.remote_addr);
2386            fmt.field("initial_remote_addr", &self.initial_remote_addr);
2387            fmt.finish()
2388        }
2389    }
2390    impl<'a> Event for HandshakeRemoteAddressChangeObserved<'a> {
2391        const NAME: &'static str = "transport:handshake_remote_address_change_observed";
2392    }
2393    #[derive(Clone, Debug)]
2394    #[non_exhaustive]
2395    #[doc = " ConnectionId updated"]
2396    pub struct ConnectionIdUpdated<'a> {
2397        pub path_id: u64,
2398        #[doc = " The endpoint that updated its connection id"]
2399        pub cid_consumer: crate::endpoint::Location,
2400        pub previous: ConnectionId<'a>,
2401        pub current: ConnectionId<'a>,
2402    }
2403    #[cfg(any(test, feature = "testing"))]
2404    impl<'a> crate::event::snapshot::Fmt for ConnectionIdUpdated<'a> {
2405        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2406            let mut fmt = fmt.debug_struct("ConnectionIdUpdated");
2407            fmt.field("path_id", &self.path_id);
2408            fmt.field("cid_consumer", &self.cid_consumer);
2409            fmt.field("previous", &self.previous);
2410            fmt.field("current", &self.current);
2411            fmt.finish()
2412        }
2413    }
2414    impl<'a> Event for ConnectionIdUpdated<'a> {
2415        const NAME: &'static str = "connectivity:connection_id_updated";
2416    }
2417    #[derive(Clone, Debug)]
2418    #[non_exhaustive]
2419    pub struct EcnStateChanged<'a> {
2420        pub path: Path<'a>,
2421        pub state: EcnState,
2422    }
2423    #[cfg(any(test, feature = "testing"))]
2424    impl<'a> crate::event::snapshot::Fmt for EcnStateChanged<'a> {
2425        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2426            let mut fmt = fmt.debug_struct("EcnStateChanged");
2427            fmt.field("path", &self.path);
2428            fmt.field("state", &self.state);
2429            fmt.finish()
2430        }
2431    }
2432    impl<'a> Event for EcnStateChanged<'a> {
2433        const NAME: &'static str = "recovery:ecn_state_changed";
2434    }
2435    #[derive(Clone, Debug)]
2436    #[non_exhaustive]
2437    pub struct ConnectionMigrationDenied {
2438        pub reason: MigrationDenyReason,
2439    }
2440    #[cfg(any(test, feature = "testing"))]
2441    impl crate::event::snapshot::Fmt for ConnectionMigrationDenied {
2442        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2443            let mut fmt = fmt.debug_struct("ConnectionMigrationDenied");
2444            fmt.field("reason", &self.reason);
2445            fmt.finish()
2446        }
2447    }
2448    impl Event for ConnectionMigrationDenied {
2449        const NAME: &'static str = "connectivity:connection_migration_denied";
2450    }
2451    #[derive(Clone, Debug)]
2452    #[non_exhaustive]
2453    pub struct HandshakeStatusUpdated {
2454        pub status: HandshakeStatus,
2455    }
2456    #[cfg(any(test, feature = "testing"))]
2457    impl crate::event::snapshot::Fmt for HandshakeStatusUpdated {
2458        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2459            let mut fmt = fmt.debug_struct("HandshakeStatusUpdated");
2460            fmt.field("status", &self.status);
2461            fmt.finish()
2462        }
2463    }
2464    impl Event for HandshakeStatusUpdated {
2465        const NAME: &'static str = "connectivity:handshake_status_updated";
2466    }
2467    #[derive(Clone, Debug)]
2468    #[non_exhaustive]
2469    pub struct TlsExporterReady<'a> {
2470        pub session: crate::event::TlsSession<'a>,
2471    }
2472    #[cfg(any(test, feature = "testing"))]
2473    impl<'a> crate::event::snapshot::Fmt for TlsExporterReady<'a> {
2474        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2475            let mut fmt = fmt.debug_struct("TlsExporterReady");
2476            fmt.field("session", &self.session);
2477            fmt.finish()
2478        }
2479    }
2480    impl<'a> Event for TlsExporterReady<'a> {
2481        const NAME: &'static str = "connectivity:tls_exporter_ready";
2482    }
2483    #[derive(Clone, Debug)]
2484    #[non_exhaustive]
2485    pub struct TlsHandshakeFailed<'a> {
2486        pub session: crate::event::TlsSession<'a>,
2487        pub error: &'a (dyn core::error::Error + Send + Sync + 'static),
2488    }
2489    #[cfg(any(test, feature = "testing"))]
2490    impl<'a> crate::event::snapshot::Fmt for TlsHandshakeFailed<'a> {
2491        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2492            let mut fmt = fmt.debug_struct("TlsHandshakeFailed");
2493            fmt.field("session", &self.session);
2494            fmt.field("error", &self.error);
2495            fmt.finish()
2496        }
2497    }
2498    impl<'a> Event for TlsHandshakeFailed<'a> {
2499        const NAME: &'static str = "connectivity:tls_handshake_failed";
2500    }
2501    #[derive(Clone, Debug)]
2502    #[non_exhaustive]
2503    #[doc = " Path challenge updated"]
2504    pub struct PathChallengeUpdated<'a> {
2505        pub path_challenge_status: PathChallengeStatus,
2506        pub path: Path<'a>,
2507        pub challenge_data: &'a [u8],
2508    }
2509    #[cfg(any(test, feature = "testing"))]
2510    impl<'a> crate::event::snapshot::Fmt for PathChallengeUpdated<'a> {
2511        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2512            let mut fmt = fmt.debug_struct("PathChallengeUpdated");
2513            fmt.field("path_challenge_status", &self.path_challenge_status);
2514            fmt.field("path", &self.path);
2515            fmt.field("challenge_data", &self.challenge_data);
2516            fmt.finish()
2517        }
2518    }
2519    impl<'a> Event for PathChallengeUpdated<'a> {
2520        const NAME: &'static str = "connectivity:path_challenge_updated";
2521    }
2522    #[derive(Clone, Debug)]
2523    #[non_exhaustive]
2524    pub struct TlsClientHello<'a> {
2525        pub payload: &'a [&'a [u8]],
2526    }
2527    #[cfg(any(test, feature = "testing"))]
2528    impl<'a> crate::event::snapshot::Fmt for TlsClientHello<'a> {
2529        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2530            let mut fmt = fmt.debug_struct("TlsClientHello");
2531            fmt.field("payload", &self.payload);
2532            fmt.finish()
2533        }
2534    }
2535    impl<'a> Event for TlsClientHello<'a> {
2536        const NAME: &'static str = "tls:client_hello";
2537    }
2538    #[derive(Clone, Debug)]
2539    #[non_exhaustive]
2540    pub struct TlsServerHello<'a> {
2541        pub payload: &'a [&'a [u8]],
2542    }
2543    #[cfg(any(test, feature = "testing"))]
2544    impl<'a> crate::event::snapshot::Fmt for TlsServerHello<'a> {
2545        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2546            let mut fmt = fmt.debug_struct("TlsServerHello");
2547            fmt.field("payload", &self.payload);
2548            fmt.finish()
2549        }
2550    }
2551    impl<'a> Event for TlsServerHello<'a> {
2552        const NAME: &'static str = "tls:server_hello";
2553    }
2554    #[derive(Clone, Debug)]
2555    #[non_exhaustive]
2556    pub struct RxStreamProgress {
2557        pub bytes: usize,
2558    }
2559    #[cfg(any(test, feature = "testing"))]
2560    impl crate::event::snapshot::Fmt for RxStreamProgress {
2561        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2562            let mut fmt = fmt.debug_struct("RxStreamProgress");
2563            fmt.field("bytes", &self.bytes);
2564            fmt.finish()
2565        }
2566    }
2567    impl Event for RxStreamProgress {
2568        const NAME: &'static str = "transport:rx_stream_progress";
2569    }
2570    #[derive(Clone, Debug)]
2571    #[non_exhaustive]
2572    pub struct TxStreamProgress {
2573        pub bytes: usize,
2574    }
2575    #[cfg(any(test, feature = "testing"))]
2576    impl crate::event::snapshot::Fmt for TxStreamProgress {
2577        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2578            let mut fmt = fmt.debug_struct("TxStreamProgress");
2579            fmt.field("bytes", &self.bytes);
2580            fmt.finish()
2581        }
2582    }
2583    impl Event for TxStreamProgress {
2584        const NAME: &'static str = "transport:tx_stream_progress";
2585    }
2586    #[derive(Clone, Debug)]
2587    #[non_exhaustive]
2588    pub struct KeepAliveTimerExpired {
2589        pub timeout: Duration,
2590    }
2591    #[cfg(any(test, feature = "testing"))]
2592    impl crate::event::snapshot::Fmt for KeepAliveTimerExpired {
2593        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2594            let mut fmt = fmt.debug_struct("KeepAliveTimerExpired");
2595            fmt.field("timeout", &self.timeout);
2596            fmt.finish()
2597        }
2598    }
2599    impl Event for KeepAliveTimerExpired {
2600        const NAME: &'static str = "connectivity::keep_alive_timer_expired";
2601    }
2602    #[derive(Clone, Debug)]
2603    #[non_exhaustive]
2604    #[doc = " The maximum transmission unit (MTU) and/or MTU probing status for the path has changed"]
2605    pub struct MtuUpdated {
2606        pub path_id: u64,
2607        #[doc = " The maximum QUIC datagram size, not including UDP and IP headers"]
2608        pub mtu: u16,
2609        pub cause: MtuUpdatedCause,
2610        #[doc = " The search for the maximum MTU has completed for now"]
2611        pub search_complete: bool,
2612    }
2613    #[cfg(any(test, feature = "testing"))]
2614    impl crate::event::snapshot::Fmt for MtuUpdated {
2615        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2616            let mut fmt = fmt.debug_struct("MtuUpdated");
2617            fmt.field("path_id", &self.path_id);
2618            fmt.field("mtu", &self.mtu);
2619            fmt.field("cause", &self.cause);
2620            fmt.field("search_complete", &self.search_complete);
2621            fmt.finish()
2622        }
2623    }
2624    impl Event for MtuUpdated {
2625        const NAME: &'static str = "connectivity:mtu_updated";
2626    }
2627    #[derive(Clone, Debug)]
2628    #[non_exhaustive]
2629    #[doc = " MTU_PROBING_COMPLETE frame was received"]
2630    pub struct MtuProbingCompleteReceived<'a> {
2631        pub packet_header: PacketHeader,
2632        pub path: Path<'a>,
2633        #[doc = " The confirmed MTU value from the frame"]
2634        pub mtu: u16,
2635    }
2636    #[cfg(any(test, feature = "testing"))]
2637    impl<'a> crate::event::snapshot::Fmt for MtuProbingCompleteReceived<'a> {
2638        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2639            let mut fmt = fmt.debug_struct("MtuProbingCompleteReceived");
2640            fmt.field("packet_header", &self.packet_header);
2641            fmt.field("path", &self.path);
2642            fmt.field("mtu", &self.mtu);
2643            fmt.finish()
2644        }
2645    }
2646    impl<'a> Event for MtuProbingCompleteReceived<'a> {
2647        const NAME: &'static str = "transport:mtu_probing_complete_received";
2648    }
2649    #[derive(Clone, Debug)]
2650    #[non_exhaustive]
2651    #[doc = " The slow start congestion controller state has been exited"]
2652    pub struct SlowStartExited {
2653        pub path_id: u64,
2654        pub cause: SlowStartExitCause,
2655        pub congestion_window: u32,
2656    }
2657    #[cfg(any(test, feature = "testing"))]
2658    impl crate::event::snapshot::Fmt for SlowStartExited {
2659        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2660            let mut fmt = fmt.debug_struct("SlowStartExited");
2661            fmt.field("path_id", &self.path_id);
2662            fmt.field("cause", &self.cause);
2663            fmt.field("congestion_window", &self.congestion_window);
2664            fmt.finish()
2665        }
2666    }
2667    impl Event for SlowStartExited {
2668        const NAME: &'static str = "recovery:slow_start_exited";
2669    }
2670    #[derive(Clone, Debug)]
2671    #[non_exhaustive]
2672    #[doc = " A new delivery rate sample has been generated"]
2673    #[doc = " Note: This event is only recorded for congestion controllers that support"]
2674    #[doc = "       bandwidth estimates, such as BBR"]
2675    pub struct DeliveryRateSampled {
2676        pub path_id: u64,
2677        pub rate_sample: RateSample,
2678    }
2679    #[cfg(any(test, feature = "testing"))]
2680    impl crate::event::snapshot::Fmt for DeliveryRateSampled {
2681        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2682            let mut fmt = fmt.debug_struct("DeliveryRateSampled");
2683            fmt.field("path_id", &self.path_id);
2684            fmt.field("rate_sample", &self.rate_sample);
2685            fmt.finish()
2686        }
2687    }
2688    impl Event for DeliveryRateSampled {
2689        const NAME: &'static str = "recovery:delivery_rate_sampled";
2690    }
2691    #[derive(Clone, Debug)]
2692    #[non_exhaustive]
2693    #[doc = " The pacing rate has been updated"]
2694    pub struct PacingRateUpdated {
2695        pub path_id: u64,
2696        pub bytes_per_second: u64,
2697        pub burst_size: u32,
2698        pub pacing_gain: f32,
2699    }
2700    #[cfg(any(test, feature = "testing"))]
2701    impl crate::event::snapshot::Fmt for PacingRateUpdated {
2702        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2703            let mut fmt = fmt.debug_struct("PacingRateUpdated");
2704            fmt.field("path_id", &self.path_id);
2705            fmt.field("bytes_per_second", &self.bytes_per_second);
2706            fmt.field("burst_size", &self.burst_size);
2707            fmt.field("pacing_gain", &self.pacing_gain);
2708            fmt.finish()
2709        }
2710    }
2711    impl Event for PacingRateUpdated {
2712        const NAME: &'static str = "recovery:pacing_rate_updated";
2713    }
2714    #[derive(Clone, Debug)]
2715    #[non_exhaustive]
2716    #[doc = " The BBR state has changed"]
2717    pub struct BbrStateChanged {
2718        pub path_id: u64,
2719        pub state: BbrState,
2720    }
2721    #[cfg(any(test, feature = "testing"))]
2722    impl crate::event::snapshot::Fmt for BbrStateChanged {
2723        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2724            let mut fmt = fmt.debug_struct("BbrStateChanged");
2725            fmt.field("path_id", &self.path_id);
2726            fmt.field("state", &self.state);
2727            fmt.finish()
2728        }
2729    }
2730    impl Event for BbrStateChanged {
2731        const NAME: &'static str = "recovery:bbr_state_changed";
2732    }
2733    #[derive(Clone, Debug)]
2734    #[non_exhaustive]
2735    #[doc = " The DC state has changed"]
2736    pub struct DcStateChanged {
2737        pub state: DcState,
2738    }
2739    #[cfg(any(test, feature = "testing"))]
2740    impl crate::event::snapshot::Fmt for DcStateChanged {
2741        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2742            let mut fmt = fmt.debug_struct("DcStateChanged");
2743            fmt.field("state", &self.state);
2744            fmt.finish()
2745        }
2746    }
2747    impl Event for DcStateChanged {
2748        const NAME: &'static str = "transport:dc_state_changed";
2749    }
2750    #[derive(Clone, Debug)]
2751    #[non_exhaustive]
2752    #[doc = " The DC path has been created"]
2753    pub struct DcPathCreated<'a> {
2754        #[doc = " This is the dc::Path struct, it's just type-erased. But if an event subscriber knows the"]
2755        #[doc = " type they can downcast."]
2756        pub path: &'a (dyn core::any::Any + Send + 'static),
2757    }
2758    #[cfg(any(test, feature = "testing"))]
2759    impl<'a> crate::event::snapshot::Fmt for DcPathCreated<'a> {
2760        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2761            let mut fmt = fmt.debug_struct("DcPathCreated");
2762            fmt.field("path", &self.path);
2763            fmt.finish()
2764        }
2765    }
2766    impl<'a> Event for DcPathCreated<'a> {
2767        const NAME: &'static str = "transport:dc_path_created";
2768    }
2769    #[derive(Clone, Debug)]
2770    #[non_exhaustive]
2771    #[doc = " Connection closed"]
2772    pub struct ConnectionClosed {
2773        pub error: crate::connection::Error,
2774    }
2775    #[cfg(any(test, feature = "testing"))]
2776    impl crate::event::snapshot::Fmt for ConnectionClosed {
2777        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2778            let mut fmt = fmt.debug_struct("ConnectionClosed");
2779            fmt.field("error", &self.error);
2780            fmt.finish()
2781        }
2782    }
2783    impl Event for ConnectionClosed {
2784        const NAME: &'static str = "connectivity:connection_closed";
2785    }
2786    #[derive(Clone, Debug)]
2787    #[non_exhaustive]
2788    #[doc = " QUIC version"]
2789    pub struct VersionInformation<'a> {
2790        pub server_versions: &'a [u32],
2791        pub client_versions: &'a [u32],
2792        pub chosen_version: Option<u32>,
2793    }
2794    #[cfg(any(test, feature = "testing"))]
2795    impl<'a> crate::event::snapshot::Fmt for VersionInformation<'a> {
2796        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2797            let mut fmt = fmt.debug_struct("VersionInformation");
2798            fmt.field("server_versions", &self.server_versions);
2799            fmt.field("client_versions", &self.client_versions);
2800            fmt.field("chosen_version", &self.chosen_version);
2801            fmt.finish()
2802        }
2803    }
2804    impl<'a> Event for VersionInformation<'a> {
2805        const NAME: &'static str = "transport::version_information";
2806    }
2807    #[derive(Clone, Debug)]
2808    #[non_exhaustive]
2809    #[doc = " Packet was sent by the endpoint"]
2810    pub struct EndpointPacketSent {
2811        pub packet_header: PacketHeader,
2812    }
2813    #[cfg(any(test, feature = "testing"))]
2814    impl crate::event::snapshot::Fmt for EndpointPacketSent {
2815        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2816            let mut fmt = fmt.debug_struct("EndpointPacketSent");
2817            fmt.field("packet_header", &self.packet_header);
2818            fmt.finish()
2819        }
2820    }
2821    impl Event for EndpointPacketSent {
2822        const NAME: &'static str = "transport:packet_sent";
2823    }
2824    #[derive(Clone, Debug)]
2825    #[non_exhaustive]
2826    #[doc = " Packet was received by the endpoint"]
2827    pub struct EndpointPacketReceived {
2828        pub packet_header: PacketHeader,
2829    }
2830    #[cfg(any(test, feature = "testing"))]
2831    impl crate::event::snapshot::Fmt for EndpointPacketReceived {
2832        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2833            let mut fmt = fmt.debug_struct("EndpointPacketReceived");
2834            fmt.field("packet_header", &self.packet_header);
2835            fmt.finish()
2836        }
2837    }
2838    impl Event for EndpointPacketReceived {
2839        const NAME: &'static str = "transport:packet_received";
2840    }
2841    #[derive(Clone, Debug)]
2842    #[non_exhaustive]
2843    #[doc = " Datagram sent by the endpoint"]
2844    pub struct EndpointDatagramSent {
2845        pub len: u16,
2846        #[doc = " The GSO offset at which this datagram was written"]
2847        #[doc = ""]
2848        #[doc = " If this value is greater than 0, it indicates that this datagram has been sent with other"]
2849        #[doc = " segments in a single buffer."]
2850        #[doc = ""]
2851        #[doc = " See the [Linux kernel documentation](https://www.kernel.org/doc/html/latest/networking/segmentation-offloads.html#generic-segmentation-offload) for more details."]
2852        pub gso_offset: usize,
2853    }
2854    #[cfg(any(test, feature = "testing"))]
2855    impl crate::event::snapshot::Fmt for EndpointDatagramSent {
2856        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2857            let mut fmt = fmt.debug_struct("EndpointDatagramSent");
2858            fmt.field("len", &self.len);
2859            fmt.field("gso_offset", &self.gso_offset);
2860            fmt.finish()
2861        }
2862    }
2863    impl Event for EndpointDatagramSent {
2864        const NAME: &'static str = "transport:datagram_sent";
2865    }
2866    #[derive(Clone, Debug)]
2867    #[non_exhaustive]
2868    #[doc = " Datagram received by the endpoint"]
2869    pub struct EndpointDatagramReceived {
2870        pub len: u16,
2871    }
2872    #[cfg(any(test, feature = "testing"))]
2873    impl crate::event::snapshot::Fmt for EndpointDatagramReceived {
2874        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2875            let mut fmt = fmt.debug_struct("EndpointDatagramReceived");
2876            fmt.field("len", &self.len);
2877            fmt.finish()
2878        }
2879    }
2880    impl Event for EndpointDatagramReceived {
2881        const NAME: &'static str = "transport:datagram_received";
2882    }
2883    #[derive(Clone, Debug)]
2884    #[non_exhaustive]
2885    #[doc = " Datagram dropped by the endpoint"]
2886    pub struct EndpointDatagramDropped {
2887        pub len: u16,
2888        pub reason: DatagramDropReason,
2889    }
2890    #[cfg(any(test, feature = "testing"))]
2891    impl crate::event::snapshot::Fmt for EndpointDatagramDropped {
2892        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2893            let mut fmt = fmt.debug_struct("EndpointDatagramDropped");
2894            fmt.field("len", &self.len);
2895            fmt.field("reason", &self.reason);
2896            fmt.finish()
2897        }
2898    }
2899    impl Event for EndpointDatagramDropped {
2900        const NAME: &'static str = "transport:datagram_dropped";
2901    }
2902    #[derive(Clone, Debug)]
2903    #[non_exhaustive]
2904    pub struct EndpointConnectionAttemptFailed {
2905        pub error: crate::connection::Error,
2906    }
2907    #[cfg(any(test, feature = "testing"))]
2908    impl crate::event::snapshot::Fmt for EndpointConnectionAttemptFailed {
2909        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2910            let mut fmt = fmt.debug_struct("EndpointConnectionAttemptFailed");
2911            fmt.field("error", &self.error);
2912            fmt.finish()
2913        }
2914    }
2915    impl Event for EndpointConnectionAttemptFailed {
2916        const NAME: &'static str = "transport:connection_attempt_failed";
2917    }
2918    #[derive(Clone, Debug)]
2919    #[non_exhaustive]
2920    pub struct EndpointConnectionAttemptDeduplicated {
2921        #[doc = " The internal connection ID this deduplicated with."]
2922        pub connection_id: u64,
2923        pub already_open: bool,
2924    }
2925    #[cfg(any(test, feature = "testing"))]
2926    impl crate::event::snapshot::Fmt for EndpointConnectionAttemptDeduplicated {
2927        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2928            let mut fmt = fmt.debug_struct("EndpointConnectionAttemptDeduplicated");
2929            fmt.field("connection_id", &self.connection_id);
2930            fmt.field("already_open", &self.already_open);
2931            fmt.finish()
2932        }
2933    }
2934    impl Event for EndpointConnectionAttemptDeduplicated {
2935        const NAME: &'static str = "endpoint:connection_attempt_deduplicated";
2936    }
2937    #[derive(Clone, Debug)]
2938    #[non_exhaustive]
2939    #[doc = " Emitted when the platform sends at least one packet"]
2940    pub struct PlatformTx {
2941        #[doc = " The number of packets sent"]
2942        pub count: usize,
2943        #[doc = " The number of syscalls performed"]
2944        pub syscalls: usize,
2945        #[doc = " The number of syscalls that got blocked"]
2946        pub blocked_syscalls: usize,
2947        #[doc = " The total number of errors encountered since the last event"]
2948        pub total_errors: usize,
2949        #[doc = " The number of specific error codes dropped"]
2950        #[doc = ""]
2951        #[doc = " This can happen when a burst of errors exceeds the capacity of the recorder"]
2952        pub dropped_errors: usize,
2953    }
2954    #[cfg(any(test, feature = "testing"))]
2955    impl crate::event::snapshot::Fmt for PlatformTx {
2956        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2957            let mut fmt = fmt.debug_struct("PlatformTx");
2958            fmt.field("count", &self.count);
2959            fmt.field("syscalls", &self.syscalls);
2960            fmt.field("blocked_syscalls", &self.blocked_syscalls);
2961            fmt.field("total_errors", &self.total_errors);
2962            fmt.field("dropped_errors", &self.dropped_errors);
2963            fmt.finish()
2964        }
2965    }
2966    impl Event for PlatformTx {
2967        const NAME: &'static str = "platform:tx";
2968    }
2969    #[derive(Clone, Debug)]
2970    #[non_exhaustive]
2971    #[doc = " Emitted when the platform returns an error while sending datagrams"]
2972    pub struct PlatformTxError {
2973        #[doc = " The error code returned by the platform"]
2974        pub errno: i32,
2975    }
2976    #[cfg(any(test, feature = "testing"))]
2977    impl crate::event::snapshot::Fmt for PlatformTxError {
2978        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
2979            let mut fmt = fmt.debug_struct("PlatformTxError");
2980            fmt.field("errno", &self.errno);
2981            fmt.finish()
2982        }
2983    }
2984    impl Event for PlatformTxError {
2985        const NAME: &'static str = "platform:tx_error";
2986    }
2987    #[derive(Clone, Debug)]
2988    #[non_exhaustive]
2989    #[doc = " Emitted when the platform receives at least one packet"]
2990    pub struct PlatformRx {
2991        #[doc = " The number of packets received"]
2992        pub count: usize,
2993        #[doc = " The number of syscalls performed"]
2994        pub syscalls: usize,
2995        #[doc = " The number of syscalls that got blocked"]
2996        pub blocked_syscalls: usize,
2997        #[doc = " The total number of errors encountered since the last event"]
2998        pub total_errors: usize,
2999        #[doc = " The number of specific error codes dropped"]
3000        #[doc = ""]
3001        #[doc = " This can happen when a burst of errors exceeds the capacity of the recorder"]
3002        pub dropped_errors: usize,
3003    }
3004    #[cfg(any(test, feature = "testing"))]
3005    impl crate::event::snapshot::Fmt for PlatformRx {
3006        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
3007            let mut fmt = fmt.debug_struct("PlatformRx");
3008            fmt.field("count", &self.count);
3009            fmt.field("syscalls", &self.syscalls);
3010            fmt.field("blocked_syscalls", &self.blocked_syscalls);
3011            fmt.field("total_errors", &self.total_errors);
3012            fmt.field("dropped_errors", &self.dropped_errors);
3013            fmt.finish()
3014        }
3015    }
3016    impl Event for PlatformRx {
3017        const NAME: &'static str = "platform:rx";
3018    }
3019    #[derive(Clone, Debug)]
3020    #[non_exhaustive]
3021    #[doc = " Emitted when the platform returns an error while receiving datagrams"]
3022    pub struct PlatformRxError {
3023        #[doc = " The error code returned by the platform"]
3024        pub errno: i32,
3025    }
3026    #[cfg(any(test, feature = "testing"))]
3027    impl crate::event::snapshot::Fmt for PlatformRxError {
3028        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
3029            let mut fmt = fmt.debug_struct("PlatformRxError");
3030            fmt.field("errno", &self.errno);
3031            fmt.finish()
3032        }
3033    }
3034    impl Event for PlatformRxError {
3035        const NAME: &'static str = "platform:rx_error";
3036    }
3037    #[derive(Clone, Debug)]
3038    #[non_exhaustive]
3039    #[doc = " Emitted when a platform feature is configured"]
3040    pub struct PlatformFeatureConfigured {
3041        pub configuration: PlatformFeatureConfiguration,
3042    }
3043    #[cfg(any(test, feature = "testing"))]
3044    impl crate::event::snapshot::Fmt for PlatformFeatureConfigured {
3045        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
3046            let mut fmt = fmt.debug_struct("PlatformFeatureConfigured");
3047            fmt.field("configuration", &self.configuration);
3048            fmt.finish()
3049        }
3050    }
3051    impl Event for PlatformFeatureConfigured {
3052        const NAME: &'static str = "platform:feature_configured";
3053    }
3054    #[derive(Clone, Debug)]
3055    #[non_exhaustive]
3056    pub struct PlatformEventLoopWakeup {
3057        pub timeout_expired: bool,
3058        pub rx_ready: bool,
3059        pub tx_ready: bool,
3060        pub application_wakeup: bool,
3061    }
3062    #[cfg(any(test, feature = "testing"))]
3063    impl crate::event::snapshot::Fmt for PlatformEventLoopWakeup {
3064        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
3065            let mut fmt = fmt.debug_struct("PlatformEventLoopWakeup");
3066            fmt.field("timeout_expired", &self.timeout_expired);
3067            fmt.field("rx_ready", &self.rx_ready);
3068            fmt.field("tx_ready", &self.tx_ready);
3069            fmt.field("application_wakeup", &self.application_wakeup);
3070            fmt.finish()
3071        }
3072    }
3073    impl Event for PlatformEventLoopWakeup {
3074        const NAME: &'static str = "platform:event_loop_wakeup";
3075    }
3076    #[derive(Clone, Debug)]
3077    #[non_exhaustive]
3078    pub struct PlatformEventLoopSleep {
3079        #[doc = " The next time at which the event loop will wake"]
3080        pub timeout: Option<core::time::Duration>,
3081        #[doc = " The amount of time spent processing endpoint events in a single event loop"]
3082        pub processing_duration: core::time::Duration,
3083    }
3084    #[cfg(any(test, feature = "testing"))]
3085    impl crate::event::snapshot::Fmt for PlatformEventLoopSleep {
3086        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
3087            let mut fmt = fmt.debug_struct("PlatformEventLoopSleep");
3088            fmt.field("timeout", &self.timeout);
3089            fmt.field("processing_duration", &self.processing_duration);
3090            fmt.finish()
3091        }
3092    }
3093    impl Event for PlatformEventLoopSleep {
3094        const NAME: &'static str = "platform:event_loop_sleep";
3095    }
3096    #[derive(Clone, Debug)]
3097    #[non_exhaustive]
3098    pub struct PlatformEventLoopStarted<'a> {
3099        #[doc = " The local address of the socket"]
3100        pub local_address: SocketAddress<'a>,
3101    }
3102    #[cfg(any(test, feature = "testing"))]
3103    impl<'a> crate::event::snapshot::Fmt for PlatformEventLoopStarted<'a> {
3104        fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
3105            let mut fmt = fmt.debug_struct("PlatformEventLoopStarted");
3106            fmt.field("local_address", &self.local_address);
3107            fmt.finish()
3108        }
3109    }
3110    impl<'a> Event for PlatformEventLoopStarted<'a> {
3111        const NAME: &'static str = "platform:started";
3112    }
3113    #[derive(Clone, Debug)]
3114    #[non_exhaustive]
3115    pub enum PlatformFeatureConfiguration {
3116        #[non_exhaustive]
3117        #[doc = " Emitted when segment offload was configured"]
3118        Gso {
3119            #[doc = " The maximum number of segments that can be sent in a single GSO packet"]
3120            #[doc = ""]
3121            #[doc = " If this value not greater than 1, GSO is disabled."]
3122            max_segments: usize,
3123        },
3124        #[non_exhaustive]
3125        #[doc = " Emitted when receive segment offload was configured"]
3126        Gro { enabled: bool },
3127        #[non_exhaustive]
3128        #[doc = " Emitted when ECN support is configured"]
3129        Ecn { enabled: bool },
3130        #[non_exhaustive]
3131        #[doc = " Emitted when the base maximum transmission unit is configured"]
3132        BaseMtu { mtu: u16 },
3133        #[non_exhaustive]
3134        #[doc = " Emitted when the initial maximum transmission unit is configured"]
3135        InitialMtu { mtu: u16 },
3136        #[non_exhaustive]
3137        #[doc = " Emitted when the max maximum transmission unit is configured"]
3138        MaxMtu { mtu: u16 },
3139    }
3140    impl aggregate::AsVariant for PlatformFeatureConfiguration {
3141        const VARIANTS: &'static [aggregate::info::Variant] = &[
3142            aggregate::info::variant::Builder {
3143                name: aggregate::info::Str::new("GSO\0"),
3144                id: 0usize,
3145            }
3146            .build(),
3147            aggregate::info::variant::Builder {
3148                name: aggregate::info::Str::new("GRO\0"),
3149                id: 1usize,
3150            }
3151            .build(),
3152            aggregate::info::variant::Builder {
3153                name: aggregate::info::Str::new("ECN\0"),
3154                id: 2usize,
3155            }
3156            .build(),
3157            aggregate::info::variant::Builder {
3158                name: aggregate::info::Str::new("BASE_MTU\0"),
3159                id: 3usize,
3160            }
3161            .build(),
3162            aggregate::info::variant::Builder {
3163                name: aggregate::info::Str::new("INITIAL_MTU\0"),
3164                id: 4usize,
3165            }
3166            .build(),
3167            aggregate::info::variant::Builder {
3168                name: aggregate::info::Str::new("MAX_MTU\0"),
3169                id: 5usize,
3170            }
3171            .build(),
3172        ];
3173        #[inline]
3174        fn variant_idx(&self) -> usize {
3175            match self {
3176                Self::Gso { .. } => 0usize,
3177                Self::Gro { .. } => 1usize,
3178                Self::Ecn { .. } => 2usize,
3179                Self::BaseMtu { .. } => 3usize,
3180                Self::InitialMtu { .. } => 4usize,
3181                Self::MaxMtu { .. } => 5usize,
3182            }
3183        }
3184    }
3185    impl<'a> IntoEvent<&'a (dyn core::any::Any + Send + Sync)>
3186        for &'a (dyn core::any::Any + Send + Sync)
3187    {
3188        #[inline]
3189        fn into_event(self) -> Self {
3190            self
3191        }
3192    }
3193    impl<'a> IntoEvent<builder::PreferredAddress<'a>>
3194        for &'a crate::transport::parameters::PreferredAddress
3195    {
3196        #[inline]
3197        fn into_event(self) -> builder::PreferredAddress<'a> {
3198            builder::PreferredAddress {
3199                ipv4_address: self.ipv4_address.as_ref().map(|addr| addr.into_event()),
3200                ipv6_address: self.ipv6_address.as_ref().map(|addr| addr.into_event()),
3201                connection_id: self.connection_id.into_event(),
3202                stateless_reset_token: self.stateless_reset_token.as_ref(),
3203            }
3204        }
3205    }
3206    impl<'a> IntoEvent<builder::SocketAddress<'a>> for &'a crate::inet::ipv4::SocketAddressV4 {
3207        #[inline]
3208        fn into_event(self) -> builder::SocketAddress<'a> {
3209            builder::SocketAddress::IpV4 {
3210                ip: &self.ip.octets,
3211                port: self.port.into(),
3212            }
3213        }
3214    }
3215    impl<'a> IntoEvent<builder::SocketAddress<'a>> for &'a crate::inet::ipv6::SocketAddressV6 {
3216        #[inline]
3217        fn into_event(self) -> builder::SocketAddress<'a> {
3218            builder::SocketAddress::IpV6 {
3219                ip: &self.ip.octets,
3220                port: self.port.into(),
3221            }
3222        }
3223    }
3224    impl IntoEvent<bool> for &crate::transport::parameters::MigrationSupport {
3225        #[inline]
3226        fn into_event(self) -> bool {
3227            match self {
3228                crate::transport::parameters::MigrationSupport::Enabled => true,
3229                crate::transport::parameters::MigrationSupport::Disabled => false,
3230            }
3231        }
3232    }
3233    impl<'a> core::fmt::Debug for ConnectionId<'a> {
3234        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
3235            write!(f, "0x")?;
3236            for byte in self.bytes {
3237                write!(f, "{byte:02x}")?;
3238            }
3239            Ok(())
3240        }
3241    }
3242    macro_rules! impl_conn_id {
3243        ($name:ident) => {
3244            impl<'a> IntoEvent<builder::ConnectionId<'a>> for &'a crate::connection::id::$name {
3245                #[inline]
3246                fn into_event(self) -> builder::ConnectionId<'a> {
3247                    builder::ConnectionId {
3248                        bytes: self.as_bytes(),
3249                    }
3250                }
3251            }
3252        };
3253    }
3254    impl_conn_id!(LocalId);
3255    impl_conn_id!(PeerId);
3256    impl_conn_id!(UnboundedId);
3257    impl_conn_id!(InitialId);
3258    impl<'a> core::fmt::Debug for SocketAddress<'a> {
3259        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
3260            match self {
3261                Self::IpV4 { ip, port } => {
3262                    let addr = crate::inet::SocketAddressV4::new(**ip, *port);
3263                    write!(f, "{addr}")?;
3264                }
3265                Self::IpV6 { ip, port } => {
3266                    let addr = crate::inet::SocketAddressV6::new(**ip, *port);
3267                    write!(f, "{addr}")?;
3268                }
3269            }
3270            Ok(())
3271        }
3272    }
3273    impl<'a> core::fmt::Display for SocketAddress<'a> {
3274        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
3275            match self {
3276                Self::IpV4 { ip, port } => {
3277                    let addr = crate::inet::SocketAddressV4::new(**ip, *port);
3278                    addr.fmt(f)?;
3279                }
3280                Self::IpV6 { ip, port } => {
3281                    let addr = crate::inet::SocketAddressV6::new(**ip, *port);
3282                    addr.fmt(f)?;
3283                }
3284            }
3285            Ok(())
3286        }
3287    }
3288    impl<'a> SocketAddress<'a> {
3289        #[inline]
3290        pub fn ip(&self) -> &'a [u8] {
3291            match self {
3292                Self::IpV4 { ip, .. } => &ip[..],
3293                Self::IpV6 { ip, .. } => &ip[..],
3294            }
3295        }
3296        #[inline]
3297        pub fn port(&self) -> u16 {
3298            match self {
3299                Self::IpV4 { port, .. } => *port,
3300                Self::IpV6 { port, .. } => *port,
3301            }
3302        }
3303    }
3304    impl<'a> IntoEvent<api::SocketAddress<'a>> for &'a crate::inet::SocketAddress {
3305        #[inline]
3306        fn into_event(self) -> api::SocketAddress<'a> {
3307            match self {
3308                crate::inet::SocketAddress::IpV4(addr) => api::SocketAddress::IpV4 {
3309                    ip: &addr.ip.octets,
3310                    port: addr.port.into(),
3311                },
3312                crate::inet::SocketAddress::IpV6(addr) => api::SocketAddress::IpV6 {
3313                    ip: &addr.ip.octets,
3314                    port: addr.port.into(),
3315                },
3316            }
3317        }
3318    }
3319    impl<'a> IntoEvent<builder::SocketAddress<'a>> for &'a crate::inet::SocketAddress {
3320        #[inline]
3321        fn into_event(self) -> builder::SocketAddress<'a> {
3322            match self {
3323                crate::inet::SocketAddress::IpV4(addr) => addr.into_event(),
3324                crate::inet::SocketAddress::IpV6(addr) => addr.into_event(),
3325            }
3326        }
3327    }
3328    impl From<SocketAddress<'_>> for core::net::SocketAddr {
3329        #[inline]
3330        fn from(address: SocketAddress) -> Self {
3331            use core::net;
3332            match address {
3333                SocketAddress::IpV4 { ip, port } => {
3334                    let ip = net::IpAddr::V4(net::Ipv4Addr::from(*ip));
3335                    Self::new(ip, port)
3336                }
3337                SocketAddress::IpV6 { ip, port } => {
3338                    let ip = net::IpAddr::V6(net::Ipv6Addr::from(*ip));
3339                    Self::new(ip, port)
3340                }
3341            }
3342        }
3343    }
3344    impl From<&SocketAddress<'_>> for core::net::SocketAddr {
3345        #[inline]
3346        fn from(address: &SocketAddress) -> Self {
3347            use core::net;
3348            match address {
3349                SocketAddress::IpV4 { ip, port } => {
3350                    let ip = net::IpAddr::V4(net::Ipv4Addr::from(**ip));
3351                    Self::new(ip, *port)
3352                }
3353                SocketAddress::IpV6 { ip, port } => {
3354                    let ip = net::IpAddr::V6(net::Ipv6Addr::from(**ip));
3355                    Self::new(ip, *port)
3356                }
3357            }
3358        }
3359    }
3360    impl IntoEvent<builder::DuplicatePacketError> for crate::packet::number::SlidingWindowError {
3361        #[inline]
3362        fn into_event(self) -> builder::DuplicatePacketError {
3363            use crate::packet::number::SlidingWindowError;
3364            match self {
3365                SlidingWindowError::TooOld => builder::DuplicatePacketError::TooOld {},
3366                SlidingWindowError::Duplicate => builder::DuplicatePacketError::Duplicate {},
3367            }
3368        }
3369    }
3370    impl IntoEvent<builder::EcnCounts> for crate::frame::ack::EcnCounts {
3371        #[inline]
3372        fn into_event(self) -> builder::EcnCounts {
3373            builder::EcnCounts {
3374                ect_0_count: self.ect_0_count.into_event(),
3375                ect_1_count: self.ect_1_count.into_event(),
3376                ce_count: self.ce_count.into_event(),
3377            }
3378        }
3379    }
3380    impl IntoEvent<builder::Frame> for &crate::frame::Padding {
3381        #[inline]
3382        fn into_event(self) -> builder::Frame {
3383            builder::Frame::Padding {}
3384        }
3385    }
3386    impl IntoEvent<builder::Frame> for &crate::frame::Ping {
3387        #[inline]
3388        fn into_event(self) -> builder::Frame {
3389            builder::Frame::Ping {}
3390        }
3391    }
3392    impl<AckRanges: crate::frame::ack::AckRanges> IntoEvent<builder::Frame>
3393        for &crate::frame::Ack<AckRanges>
3394    {
3395        #[inline]
3396        fn into_event(self) -> builder::Frame {
3397            builder::Frame::Ack {
3398                ecn_counts: self.ecn_counts.map(|val| val.into_event()),
3399                largest_acknowledged: self.largest_acknowledged().into_event(),
3400                ack_range_count: self.ack_ranges().len() as u64,
3401            }
3402        }
3403    }
3404    impl IntoEvent<builder::Frame> for &crate::frame::ResetStream {
3405        #[inline]
3406        fn into_event(self) -> builder::Frame {
3407            builder::Frame::ResetStream {
3408                id: self.stream_id.as_u64(),
3409                error_code: self.application_error_code.as_u64(),
3410                final_size: self.final_size.as_u64(),
3411            }
3412        }
3413    }
3414    impl IntoEvent<builder::Frame> for &crate::frame::StopSending {
3415        #[inline]
3416        fn into_event(self) -> builder::Frame {
3417            builder::Frame::StopSending {
3418                id: self.stream_id.as_u64(),
3419                error_code: self.application_error_code.as_u64(),
3420            }
3421        }
3422    }
3423    impl<'a> IntoEvent<builder::Frame> for &crate::frame::NewToken<'a> {
3424        #[inline]
3425        fn into_event(self) -> builder::Frame {
3426            builder::Frame::NewToken {}
3427        }
3428    }
3429    impl IntoEvent<builder::Frame> for &crate::frame::MaxData {
3430        #[inline]
3431        fn into_event(self) -> builder::Frame {
3432            builder::Frame::MaxData {
3433                value: self.maximum_data.as_u64(),
3434            }
3435        }
3436    }
3437    impl IntoEvent<builder::Frame> for &crate::frame::MaxStreamData {
3438        #[inline]
3439        fn into_event(self) -> builder::Frame {
3440            builder::Frame::MaxStreamData {
3441                id: self.stream_id.as_u64(),
3442                stream_type: crate::stream::StreamId::from_varint(self.stream_id)
3443                    .stream_type()
3444                    .into_event(),
3445                value: self.maximum_stream_data.as_u64(),
3446            }
3447        }
3448    }
3449    impl IntoEvent<builder::Frame> for &crate::frame::MaxStreams {
3450        #[inline]
3451        fn into_event(self) -> builder::Frame {
3452            builder::Frame::MaxStreams {
3453                stream_type: self.stream_type.into_event(),
3454                value: self.maximum_streams.as_u64(),
3455            }
3456        }
3457    }
3458    impl IntoEvent<builder::Frame> for &crate::frame::DataBlocked {
3459        #[inline]
3460        fn into_event(self) -> builder::Frame {
3461            builder::Frame::DataBlocked {
3462                data_limit: self.data_limit.as_u64(),
3463            }
3464        }
3465    }
3466    impl IntoEvent<builder::Frame> for &crate::frame::StreamDataBlocked {
3467        #[inline]
3468        fn into_event(self) -> builder::Frame {
3469            builder::Frame::StreamDataBlocked {
3470                stream_id: self.stream_id.as_u64(),
3471                stream_data_limit: self.stream_data_limit.as_u64(),
3472            }
3473        }
3474    }
3475    impl IntoEvent<builder::Frame> for &crate::frame::StreamsBlocked {
3476        #[inline]
3477        fn into_event(self) -> builder::Frame {
3478            builder::Frame::StreamsBlocked {
3479                stream_type: self.stream_type.into_event(),
3480                stream_limit: self.stream_limit.as_u64(),
3481            }
3482        }
3483    }
3484    impl<'a> IntoEvent<builder::Frame> for &crate::frame::NewConnectionId<'a> {
3485        #[inline]
3486        fn into_event(self) -> builder::Frame {
3487            builder::Frame::NewConnectionId {
3488                sequence_number: self.sequence_number.as_u64(),
3489                retire_prior_to: self.retire_prior_to.as_u64(),
3490            }
3491        }
3492    }
3493    impl IntoEvent<builder::Frame> for &crate::frame::RetireConnectionId {
3494        #[inline]
3495        fn into_event(self) -> builder::Frame {
3496            builder::Frame::RetireConnectionId {}
3497        }
3498    }
3499    impl<'a> IntoEvent<builder::Frame> for &crate::frame::PathChallenge<'a> {
3500        #[inline]
3501        fn into_event(self) -> builder::Frame {
3502            builder::Frame::PathChallenge {}
3503        }
3504    }
3505    impl<'a> IntoEvent<builder::Frame> for &crate::frame::PathResponse<'a> {
3506        #[inline]
3507        fn into_event(self) -> builder::Frame {
3508            builder::Frame::PathResponse {}
3509        }
3510    }
3511    impl<'a> IntoEvent<builder::Frame> for &crate::frame::ConnectionClose<'a> {
3512        #[inline]
3513        fn into_event(self) -> builder::Frame {
3514            builder::Frame::ConnectionClose {}
3515        }
3516    }
3517    impl IntoEvent<builder::Frame> for &crate::frame::HandshakeDone {
3518        #[inline]
3519        fn into_event(self) -> builder::Frame {
3520            builder::Frame::HandshakeDone {}
3521        }
3522    }
3523    impl<Data> IntoEvent<builder::Frame> for &crate::frame::Stream<Data>
3524    where
3525        Data: s2n_codec::EncoderValue,
3526    {
3527        #[inline]
3528        fn into_event(self) -> builder::Frame {
3529            builder::Frame::Stream {
3530                id: self.stream_id.as_u64(),
3531                offset: self.offset.as_u64(),
3532                len: self.data.encoding_size() as _,
3533                is_fin: self.is_fin,
3534            }
3535        }
3536    }
3537    impl<Data> IntoEvent<builder::Frame> for &crate::frame::Crypto<Data>
3538    where
3539        Data: s2n_codec::EncoderValue,
3540    {
3541        #[inline]
3542        fn into_event(self) -> builder::Frame {
3543            builder::Frame::Crypto {
3544                offset: self.offset.as_u64(),
3545                len: self.data.encoding_size() as _,
3546            }
3547        }
3548    }
3549    impl<Data> IntoEvent<builder::Frame> for &crate::frame::Datagram<Data>
3550    where
3551        Data: s2n_codec::EncoderValue,
3552    {
3553        #[inline]
3554        fn into_event(self) -> builder::Frame {
3555            builder::Frame::Datagram {
3556                len: self.data.encoding_size() as _,
3557            }
3558        }
3559    }
3560    impl<'a> IntoEvent<builder::Frame> for &crate::frame::DcStatelessResetTokens<'a> {
3561        #[inline]
3562        fn into_event(self) -> builder::Frame {
3563            builder::Frame::DcStatelessResetTokens {}
3564        }
3565    }
3566    #[cfg(feature = "alloc")]
3567    impl<'a> ConnectionCloseFrame<'a> {
3568        #[doc = " Converts the reason to a UTF-8 `str`, including invalid characters"]
3569        pub fn reason_lossy_utf8(&self) -> Option<alloc::borrow::Cow<'a, str>> {
3570            self.reason
3571                .map(|reason| alloc::string::String::from_utf8_lossy(reason))
3572        }
3573    }
3574    impl<'a> IntoEvent<builder::ConnectionCloseFrame<'a>> for &crate::frame::ConnectionClose<'a> {
3575        #[inline]
3576        fn into_event(self) -> builder::ConnectionCloseFrame<'a> {
3577            builder::ConnectionCloseFrame {
3578                error_code: self.error_code.as_u64(),
3579                frame_type: self.frame_type.into_event(),
3580                reason: self.reason.into_event(),
3581            }
3582        }
3583    }
3584    #[cfg(feature = "alloc")]
3585    impl<'a> core::fmt::Debug for ConnectionCloseFrame<'a> {
3586        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
3587            f.debug_struct("ConnectionCloseFrame")
3588                .field("error_code", &self.error_code)
3589                .field("frame_type", &self.frame_type)
3590                .field("reason", &self.reason_lossy_utf8())
3591                .finish()
3592        }
3593    }
3594    #[cfg(not(feature = "alloc"))]
3595    impl<'a> core::fmt::Debug for ConnectionCloseFrame<'a> {
3596        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
3597            write!(f, "{:?}", self)
3598        }
3599    }
3600    impl IntoEvent<builder::StreamType> for &crate::stream::StreamType {
3601        #[inline]
3602        fn into_event(self) -> builder::StreamType {
3603            match self {
3604                crate::stream::StreamType::Bidirectional => builder::StreamType::Bidirectional {},
3605                crate::stream::StreamType::Unidirectional => builder::StreamType::Unidirectional {},
3606            }
3607        }
3608    }
3609    impl builder::PacketHeader {
3610        #[inline]
3611        pub fn new(
3612            packet_number: crate::packet::number::PacketNumber,
3613            version: u32,
3614        ) -> builder::PacketHeader {
3615            use crate::packet::number::PacketNumberSpace;
3616            use builder::PacketHeader;
3617            match packet_number.space() {
3618                PacketNumberSpace::Initial => PacketHeader::Initial {
3619                    number: packet_number.into_event(),
3620                    version,
3621                },
3622                PacketNumberSpace::Handshake => PacketHeader::Handshake {
3623                    number: packet_number.into_event(),
3624                    version,
3625                },
3626                PacketNumberSpace::ApplicationData => PacketHeader::OneRtt {
3627                    number: packet_number.into_event(),
3628                },
3629            }
3630        }
3631    }
3632    impl core::fmt::Display for EndpointType {
3633        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3634            match self {
3635                Self::Client {} => write!(f, "client"),
3636                Self::Server {} => write!(f, "server"),
3637            }
3638        }
3639    }
3640    impl IntoEvent<api::EndpointType> for crate::endpoint::Type {
3641        #[inline]
3642        fn into_event(self) -> api::EndpointType {
3643            match self {
3644                Self::Client => api::EndpointType::Client {},
3645                Self::Server => api::EndpointType::Server {},
3646            }
3647        }
3648    }
3649    impl IntoEvent<builder::EndpointType> for crate::endpoint::Type {
3650        #[inline]
3651        fn into_event(self) -> builder::EndpointType {
3652            match self {
3653                Self::Client => builder::EndpointType::Client {},
3654                Self::Server => builder::EndpointType::Server {},
3655            }
3656        }
3657    }
3658    impl<'a> IntoEvent<builder::MtuConfig> for &'a crate::path::mtu::Config {
3659        #[inline]
3660        fn into_event(self) -> builder::MtuConfig {
3661            builder::MtuConfig {
3662                initial_mtu: self.initial_mtu().into(),
3663                base_mtu: self.base_mtu().into(),
3664                max_mtu: self.max_mtu().into(),
3665            }
3666        }
3667    }
3668    impl CipherSuite {
3669        #[inline]
3670        pub fn as_str(&self) -> &'static str {
3671            match self {
3672                Self::TLS_AES_128_GCM_SHA256 {} => "TLS_AES_128_GCM_SHA256",
3673                Self::TLS_AES_256_GCM_SHA384 {} => "TLS_AES_256_GCM_SHA384",
3674                Self::TLS_CHACHA20_POLY1305_SHA256 {} => "TLS_CHACHA20_POLY1305_SHA256",
3675                Self::Unknown {} => "UNKNOWN",
3676            }
3677        }
3678    }
3679    #[cfg(feature = "std")]
3680    impl From<PlatformTxError> for std::io::Error {
3681        fn from(error: PlatformTxError) -> Self {
3682            Self::from_raw_os_error(error.errno)
3683        }
3684    }
3685    #[cfg(feature = "std")]
3686    impl From<PlatformRxError> for std::io::Error {
3687        fn from(error: PlatformRxError) -> Self {
3688            Self::from_raw_os_error(error.errno)
3689        }
3690    }
3691}
3692#[cfg(feature = "event-tracing")]
3693pub mod tracing {
3694    #![doc = r" This module contains event integration with [`tracing`](https://docs.rs/tracing)"]
3695    use super::api;
3696    #[doc = r" Emits events with [`tracing`](https://docs.rs/tracing)"]
3697    #[derive(Clone, Debug)]
3698    pub struct Subscriber {
3699        client: tracing::Span,
3700        server: tracing::Span,
3701    }
3702    impl Default for Subscriber {
3703        fn default() -> Self {
3704            let root =
3705                tracing :: span ! (target : "s2n_quic" , tracing :: Level :: DEBUG , "s2n_quic");
3706            let client =
3707                tracing :: span ! (parent : root . id () , tracing :: Level :: DEBUG , "client");
3708            let server =
3709                tracing :: span ! (parent : root . id () , tracing :: Level :: DEBUG , "server");
3710            Self { client, server }
3711        }
3712    }
3713    impl Subscriber {
3714        fn parent<M: crate::event::Meta>(&self, meta: &M) -> Option<tracing::Id> {
3715            match meta.endpoint_type() {
3716                api::EndpointType::Client { .. } => self.client.id(),
3717                api::EndpointType::Server { .. } => self.server.id(),
3718            }
3719        }
3720    }
3721    impl super::Subscriber for Subscriber {
3722        type ConnectionContext = tracing::Span;
3723        fn create_connection_context(
3724            &mut self,
3725            meta: &api::ConnectionMeta,
3726            _info: &api::ConnectionInfo,
3727        ) -> Self::ConnectionContext {
3728            let parent = self.parent(meta);
3729            tracing :: span ! (target : "s2n_quic" , parent : parent , tracing :: Level :: DEBUG , "conn" , id = meta . id)
3730        }
3731        #[inline]
3732        fn on_application_protocol_information(
3733            &mut self,
3734            context: &mut Self::ConnectionContext,
3735            _meta: &api::ConnectionMeta,
3736            event: &api::ApplicationProtocolInformation,
3737        ) {
3738            let id = context.id();
3739            let api::ApplicationProtocolInformation {
3740                chosen_application_protocol,
3741            } = event;
3742            tracing :: event ! (target : "application_protocol_information" , parent : id , tracing :: Level :: DEBUG , { chosen_application_protocol = tracing :: field :: debug (chosen_application_protocol) });
3743        }
3744        #[inline]
3745        fn on_server_name_information(
3746            &mut self,
3747            context: &mut Self::ConnectionContext,
3748            _meta: &api::ConnectionMeta,
3749            event: &api::ServerNameInformation,
3750        ) {
3751            let id = context.id();
3752            let api::ServerNameInformation { chosen_server_name } = event;
3753            tracing :: event ! (target : "server_name_information" , parent : id , tracing :: Level :: DEBUG , { chosen_server_name = tracing :: field :: debug (chosen_server_name) });
3754        }
3755        #[inline]
3756        fn on_key_exchange_group(
3757            &mut self,
3758            context: &mut Self::ConnectionContext,
3759            _meta: &api::ConnectionMeta,
3760            event: &api::KeyExchangeGroup,
3761        ) {
3762            let id = context.id();
3763            let api::KeyExchangeGroup {
3764                chosen_group_name,
3765                contains_kem,
3766            } = event;
3767            tracing :: event ! (target : "key_exchange_group" , parent : id , tracing :: Level :: DEBUG , { chosen_group_name = tracing :: field :: debug (chosen_group_name) , contains_kem = tracing :: field :: debug (contains_kem) });
3768        }
3769        #[inline]
3770        fn on_packet_skipped(
3771            &mut self,
3772            context: &mut Self::ConnectionContext,
3773            _meta: &api::ConnectionMeta,
3774            event: &api::PacketSkipped,
3775        ) {
3776            let id = context.id();
3777            let api::PacketSkipped {
3778                number,
3779                space,
3780                reason,
3781            } = event;
3782            tracing :: event ! (target : "packet_skipped" , parent : id , tracing :: Level :: DEBUG , { number = tracing :: field :: debug (number) , space = tracing :: field :: debug (space) , reason = tracing :: field :: debug (reason) });
3783        }
3784        #[inline]
3785        fn on_packet_sent(
3786            &mut self,
3787            context: &mut Self::ConnectionContext,
3788            _meta: &api::ConnectionMeta,
3789            event: &api::PacketSent,
3790        ) {
3791            let id = context.id();
3792            let api::PacketSent {
3793                packet_header,
3794                packet_len,
3795            } = event;
3796            tracing :: event ! (target : "packet_sent" , parent : id , tracing :: Level :: DEBUG , { packet_header = tracing :: field :: debug (packet_header) , packet_len = tracing :: field :: debug (packet_len) });
3797        }
3798        #[inline]
3799        fn on_packet_received(
3800            &mut self,
3801            context: &mut Self::ConnectionContext,
3802            _meta: &api::ConnectionMeta,
3803            event: &api::PacketReceived,
3804        ) {
3805            let id = context.id();
3806            let api::PacketReceived { packet_header } = event;
3807            tracing :: event ! (target : "packet_received" , parent : id , tracing :: Level :: DEBUG , { packet_header = tracing :: field :: debug (packet_header) });
3808        }
3809        #[inline]
3810        fn on_active_path_updated(
3811            &mut self,
3812            context: &mut Self::ConnectionContext,
3813            _meta: &api::ConnectionMeta,
3814            event: &api::ActivePathUpdated,
3815        ) {
3816            let id = context.id();
3817            let api::ActivePathUpdated { previous, active } = event;
3818            tracing :: event ! (target : "active_path_updated" , parent : id , tracing :: Level :: DEBUG , { previous = tracing :: field :: debug (previous) , active = tracing :: field :: debug (active) });
3819        }
3820        #[inline]
3821        fn on_path_created(
3822            &mut self,
3823            context: &mut Self::ConnectionContext,
3824            _meta: &api::ConnectionMeta,
3825            event: &api::PathCreated,
3826        ) {
3827            let id = context.id();
3828            let api::PathCreated { active, new } = event;
3829            tracing :: event ! (target : "path_created" , parent : id , tracing :: Level :: DEBUG , { active = tracing :: field :: debug (active) , new = tracing :: field :: debug (new) });
3830        }
3831        #[inline]
3832        fn on_frame_sent(
3833            &mut self,
3834            context: &mut Self::ConnectionContext,
3835            _meta: &api::ConnectionMeta,
3836            event: &api::FrameSent,
3837        ) {
3838            let id = context.id();
3839            let api::FrameSent {
3840                packet_header,
3841                path_id,
3842                frame,
3843            } = event;
3844            tracing :: event ! (target : "frame_sent" , parent : id , tracing :: Level :: DEBUG , { packet_header = tracing :: field :: debug (packet_header) , path_id = tracing :: field :: debug (path_id) , frame = tracing :: field :: debug (frame) });
3845        }
3846        #[inline]
3847        fn on_frame_received(
3848            &mut self,
3849            context: &mut Self::ConnectionContext,
3850            _meta: &api::ConnectionMeta,
3851            event: &api::FrameReceived,
3852        ) {
3853            let id = context.id();
3854            let api::FrameReceived {
3855                packet_header,
3856                path,
3857                frame,
3858            } = event;
3859            tracing :: event ! (target : "frame_received" , parent : id , tracing :: Level :: DEBUG , { packet_header = tracing :: field :: debug (packet_header) , path = tracing :: field :: debug (path) , frame = tracing :: field :: debug (frame) });
3860        }
3861        #[inline]
3862        fn on_connection_close_frame_received(
3863            &mut self,
3864            context: &mut Self::ConnectionContext,
3865            _meta: &api::ConnectionMeta,
3866            event: &api::ConnectionCloseFrameReceived,
3867        ) {
3868            let id = context.id();
3869            let api::ConnectionCloseFrameReceived {
3870                packet_header,
3871                path,
3872                frame,
3873            } = event;
3874            tracing :: event ! (target : "connection_close_frame_received" , parent : id , tracing :: Level :: DEBUG , { packet_header = tracing :: field :: debug (packet_header) , path = tracing :: field :: debug (path) , frame = tracing :: field :: debug (frame) });
3875        }
3876        #[inline]
3877        fn on_packet_lost(
3878            &mut self,
3879            context: &mut Self::ConnectionContext,
3880            _meta: &api::ConnectionMeta,
3881            event: &api::PacketLost,
3882        ) {
3883            let id = context.id();
3884            let api::PacketLost {
3885                packet_header,
3886                path,
3887                bytes_lost,
3888                is_mtu_probe,
3889            } = event;
3890            tracing :: event ! (target : "packet_lost" , parent : id , tracing :: Level :: DEBUG , { packet_header = tracing :: field :: debug (packet_header) , path = tracing :: field :: debug (path) , bytes_lost = tracing :: field :: debug (bytes_lost) , is_mtu_probe = tracing :: field :: debug (is_mtu_probe) });
3891        }
3892        #[inline]
3893        fn on_recovery_metrics(
3894            &mut self,
3895            context: &mut Self::ConnectionContext,
3896            _meta: &api::ConnectionMeta,
3897            event: &api::RecoveryMetrics,
3898        ) {
3899            let id = context.id();
3900            let api::RecoveryMetrics {
3901                path,
3902                min_rtt,
3903                smoothed_rtt,
3904                latest_rtt,
3905                rtt_variance,
3906                max_ack_delay,
3907                pto_count,
3908                congestion_window,
3909                bytes_in_flight,
3910                congestion_limited,
3911            } = event;
3912            tracing :: event ! (target : "recovery_metrics" , parent : id , tracing :: Level :: DEBUG , { path = tracing :: field :: debug (path) , min_rtt = tracing :: field :: debug (min_rtt) , smoothed_rtt = tracing :: field :: debug (smoothed_rtt) , latest_rtt = tracing :: field :: debug (latest_rtt) , rtt_variance = tracing :: field :: debug (rtt_variance) , max_ack_delay = tracing :: field :: debug (max_ack_delay) , pto_count = tracing :: field :: debug (pto_count) , congestion_window = tracing :: field :: debug (congestion_window) , bytes_in_flight = tracing :: field :: debug (bytes_in_flight) , congestion_limited = tracing :: field :: debug (congestion_limited) });
3913        }
3914        #[inline]
3915        fn on_congestion(
3916            &mut self,
3917            context: &mut Self::ConnectionContext,
3918            _meta: &api::ConnectionMeta,
3919            event: &api::Congestion,
3920        ) {
3921            let id = context.id();
3922            let api::Congestion { path, source } = event;
3923            tracing :: event ! (target : "congestion" , parent : id , tracing :: Level :: DEBUG , { path = tracing :: field :: debug (path) , source = tracing :: field :: debug (source) });
3924        }
3925        #[inline]
3926        #[allow(deprecated)]
3927        fn on_ack_processed(
3928            &mut self,
3929            context: &mut Self::ConnectionContext,
3930            _meta: &api::ConnectionMeta,
3931            event: &api::AckProcessed,
3932        ) {
3933            let id = context.id();
3934            let api::AckProcessed { action, path } = event;
3935            tracing :: event ! (target : "ack_processed" , parent : id , tracing :: Level :: DEBUG , { action = tracing :: field :: debug (action) , path = tracing :: field :: debug (path) });
3936        }
3937        #[inline]
3938        fn on_rx_ack_range_dropped(
3939            &mut self,
3940            context: &mut Self::ConnectionContext,
3941            _meta: &api::ConnectionMeta,
3942            event: &api::RxAckRangeDropped,
3943        ) {
3944            let id = context.id();
3945            let api::RxAckRangeDropped {
3946                path,
3947                packet_number_range,
3948                capacity,
3949                stored_range,
3950            } = event;
3951            tracing :: event ! (target : "rx_ack_range_dropped" , parent : id , tracing :: Level :: DEBUG , { path = tracing :: field :: debug (path) , packet_number_range = tracing :: field :: debug (packet_number_range) , capacity = tracing :: field :: debug (capacity) , stored_range = tracing :: field :: debug (stored_range) });
3952        }
3953        #[inline]
3954        fn on_ack_range_received(
3955            &mut self,
3956            context: &mut Self::ConnectionContext,
3957            _meta: &api::ConnectionMeta,
3958            event: &api::AckRangeReceived,
3959        ) {
3960            let id = context.id();
3961            let api::AckRangeReceived {
3962                packet_header,
3963                path,
3964                ack_range,
3965            } = event;
3966            tracing :: event ! (target : "ack_range_received" , parent : id , tracing :: Level :: DEBUG , { packet_header = tracing :: field :: debug (packet_header) , path = tracing :: field :: debug (path) , ack_range = tracing :: field :: debug (ack_range) });
3967        }
3968        #[inline]
3969        fn on_ack_range_sent(
3970            &mut self,
3971            context: &mut Self::ConnectionContext,
3972            _meta: &api::ConnectionMeta,
3973            event: &api::AckRangeSent,
3974        ) {
3975            let id = context.id();
3976            let api::AckRangeSent {
3977                packet_header,
3978                path_id,
3979                ack_range,
3980            } = event;
3981            tracing :: event ! (target : "ack_range_sent" , parent : id , tracing :: Level :: DEBUG , { packet_header = tracing :: field :: debug (packet_header) , path_id = tracing :: field :: debug (path_id) , ack_range = tracing :: field :: debug (ack_range) });
3982        }
3983        #[inline]
3984        fn on_packet_dropped(
3985            &mut self,
3986            context: &mut Self::ConnectionContext,
3987            _meta: &api::ConnectionMeta,
3988            event: &api::PacketDropped,
3989        ) {
3990            let id = context.id();
3991            let api::PacketDropped { reason } = event;
3992            tracing :: event ! (target : "packet_dropped" , parent : id , tracing :: Level :: DEBUG , { reason = tracing :: field :: debug (reason) });
3993        }
3994        #[inline]
3995        fn on_key_update(
3996            &mut self,
3997            context: &mut Self::ConnectionContext,
3998            _meta: &api::ConnectionMeta,
3999            event: &api::KeyUpdate,
4000        ) {
4001            let id = context.id();
4002            let api::KeyUpdate {
4003                key_type,
4004                cipher_suite,
4005            } = event;
4006            tracing :: event ! (target : "key_update" , parent : id , tracing :: Level :: DEBUG , { key_type = tracing :: field :: debug (key_type) , cipher_suite = tracing :: field :: debug (cipher_suite) });
4007        }
4008        #[inline]
4009        fn on_key_space_discarded(
4010            &mut self,
4011            context: &mut Self::ConnectionContext,
4012            _meta: &api::ConnectionMeta,
4013            event: &api::KeySpaceDiscarded,
4014        ) {
4015            let id = context.id();
4016            let api::KeySpaceDiscarded { space } = event;
4017            tracing :: event ! (target : "key_space_discarded" , parent : id , tracing :: Level :: DEBUG , { space = tracing :: field :: debug (space) });
4018        }
4019        #[inline]
4020        fn on_connection_started(
4021            &mut self,
4022            context: &mut Self::ConnectionContext,
4023            _meta: &api::ConnectionMeta,
4024            event: &api::ConnectionStarted,
4025        ) {
4026            let id = context.id();
4027            let api::ConnectionStarted { path } = event;
4028            tracing :: event ! (target : "connection_started" , parent : id , tracing :: Level :: DEBUG , { path = tracing :: field :: debug (path) });
4029        }
4030        #[inline]
4031        fn on_duplicate_packet(
4032            &mut self,
4033            context: &mut Self::ConnectionContext,
4034            _meta: &api::ConnectionMeta,
4035            event: &api::DuplicatePacket,
4036        ) {
4037            let id = context.id();
4038            let api::DuplicatePacket {
4039                packet_header,
4040                path,
4041                error,
4042            } = event;
4043            tracing :: event ! (target : "duplicate_packet" , parent : id , tracing :: Level :: DEBUG , { packet_header = tracing :: field :: debug (packet_header) , path = tracing :: field :: debug (path) , error = tracing :: field :: debug (error) });
4044        }
4045        #[inline]
4046        fn on_transport_parameters_received(
4047            &mut self,
4048            context: &mut Self::ConnectionContext,
4049            _meta: &api::ConnectionMeta,
4050            event: &api::TransportParametersReceived,
4051        ) {
4052            let id = context.id();
4053            let api::TransportParametersReceived {
4054                transport_parameters,
4055            } = event;
4056            tracing :: event ! (target : "transport_parameters_received" , parent : id , tracing :: Level :: DEBUG , { transport_parameters = tracing :: field :: debug (transport_parameters) });
4057        }
4058        #[inline]
4059        fn on_datagram_sent(
4060            &mut self,
4061            context: &mut Self::ConnectionContext,
4062            _meta: &api::ConnectionMeta,
4063            event: &api::DatagramSent,
4064        ) {
4065            let id = context.id();
4066            let api::DatagramSent { len, gso_offset } = event;
4067            tracing :: event ! (target : "datagram_sent" , parent : id , tracing :: Level :: DEBUG , { len = tracing :: field :: debug (len) , gso_offset = tracing :: field :: debug (gso_offset) });
4068        }
4069        #[inline]
4070        fn on_datagram_received(
4071            &mut self,
4072            context: &mut Self::ConnectionContext,
4073            _meta: &api::ConnectionMeta,
4074            event: &api::DatagramReceived,
4075        ) {
4076            let id = context.id();
4077            let api::DatagramReceived { len } = event;
4078            tracing :: event ! (target : "datagram_received" , parent : id , tracing :: Level :: DEBUG , { len = tracing :: field :: debug (len) });
4079        }
4080        #[inline]
4081        fn on_datagram_dropped(
4082            &mut self,
4083            context: &mut Self::ConnectionContext,
4084            _meta: &api::ConnectionMeta,
4085            event: &api::DatagramDropped,
4086        ) {
4087            let id = context.id();
4088            let api::DatagramDropped {
4089                local_addr,
4090                remote_addr,
4091                destination_cid,
4092                source_cid,
4093                len,
4094                reason,
4095            } = event;
4096            tracing :: event ! (target : "datagram_dropped" , parent : id , tracing :: Level :: DEBUG , { local_addr = tracing :: field :: debug (local_addr) , remote_addr = tracing :: field :: debug (remote_addr) , destination_cid = tracing :: field :: debug (destination_cid) , source_cid = tracing :: field :: debug (source_cid) , len = tracing :: field :: debug (len) , reason = tracing :: field :: debug (reason) });
4097        }
4098        #[inline]
4099        fn on_handshake_remote_address_change_observed(
4100            &mut self,
4101            context: &mut Self::ConnectionContext,
4102            _meta: &api::ConnectionMeta,
4103            event: &api::HandshakeRemoteAddressChangeObserved,
4104        ) {
4105            let id = context.id();
4106            let api::HandshakeRemoteAddressChangeObserved {
4107                local_addr,
4108                remote_addr,
4109                initial_remote_addr,
4110            } = event;
4111            tracing :: event ! (target : "handshake_remote_address_change_observed" , parent : id , tracing :: Level :: DEBUG , { local_addr = tracing :: field :: debug (local_addr) , remote_addr = tracing :: field :: debug (remote_addr) , initial_remote_addr = tracing :: field :: debug (initial_remote_addr) });
4112        }
4113        #[inline]
4114        fn on_connection_id_updated(
4115            &mut self,
4116            context: &mut Self::ConnectionContext,
4117            _meta: &api::ConnectionMeta,
4118            event: &api::ConnectionIdUpdated,
4119        ) {
4120            let id = context.id();
4121            let api::ConnectionIdUpdated {
4122                path_id,
4123                cid_consumer,
4124                previous,
4125                current,
4126            } = event;
4127            tracing :: event ! (target : "connection_id_updated" , parent : id , tracing :: Level :: DEBUG , { path_id = tracing :: field :: debug (path_id) , cid_consumer = tracing :: field :: debug (cid_consumer) , previous = tracing :: field :: debug (previous) , current = tracing :: field :: debug (current) });
4128        }
4129        #[inline]
4130        fn on_ecn_state_changed(
4131            &mut self,
4132            context: &mut Self::ConnectionContext,
4133            _meta: &api::ConnectionMeta,
4134            event: &api::EcnStateChanged,
4135        ) {
4136            let id = context.id();
4137            let api::EcnStateChanged { path, state } = event;
4138            tracing :: event ! (target : "ecn_state_changed" , parent : id , tracing :: Level :: DEBUG , { path = tracing :: field :: debug (path) , state = tracing :: field :: debug (state) });
4139        }
4140        #[inline]
4141        fn on_connection_migration_denied(
4142            &mut self,
4143            context: &mut Self::ConnectionContext,
4144            _meta: &api::ConnectionMeta,
4145            event: &api::ConnectionMigrationDenied,
4146        ) {
4147            let id = context.id();
4148            let api::ConnectionMigrationDenied { reason } = event;
4149            tracing :: event ! (target : "connection_migration_denied" , parent : id , tracing :: Level :: DEBUG , { reason = tracing :: field :: debug (reason) });
4150        }
4151        #[inline]
4152        fn on_handshake_status_updated(
4153            &mut self,
4154            context: &mut Self::ConnectionContext,
4155            _meta: &api::ConnectionMeta,
4156            event: &api::HandshakeStatusUpdated,
4157        ) {
4158            let id = context.id();
4159            let api::HandshakeStatusUpdated { status } = event;
4160            tracing :: event ! (target : "handshake_status_updated" , parent : id , tracing :: Level :: DEBUG , { status = tracing :: field :: debug (status) });
4161        }
4162        #[inline]
4163        fn on_tls_exporter_ready(
4164            &mut self,
4165            context: &mut Self::ConnectionContext,
4166            _meta: &api::ConnectionMeta,
4167            event: &api::TlsExporterReady,
4168        ) {
4169            let id = context.id();
4170            let api::TlsExporterReady { session } = event;
4171            tracing :: event ! (target : "tls_exporter_ready" , parent : id , tracing :: Level :: DEBUG , { session = tracing :: field :: debug (session) });
4172        }
4173        #[inline]
4174        fn on_tls_handshake_failed(
4175            &mut self,
4176            context: &mut Self::ConnectionContext,
4177            _meta: &api::ConnectionMeta,
4178            event: &api::TlsHandshakeFailed,
4179        ) {
4180            let id = context.id();
4181            let api::TlsHandshakeFailed { session, error } = event;
4182            tracing :: event ! (target : "tls_handshake_failed" , parent : id , tracing :: Level :: DEBUG , { session = tracing :: field :: debug (session) , error = tracing :: field :: debug (error) });
4183        }
4184        #[inline]
4185        fn on_path_challenge_updated(
4186            &mut self,
4187            context: &mut Self::ConnectionContext,
4188            _meta: &api::ConnectionMeta,
4189            event: &api::PathChallengeUpdated,
4190        ) {
4191            let id = context.id();
4192            let api::PathChallengeUpdated {
4193                path_challenge_status,
4194                path,
4195                challenge_data,
4196            } = event;
4197            tracing :: event ! (target : "path_challenge_updated" , parent : id , tracing :: Level :: DEBUG , { path_challenge_status = tracing :: field :: debug (path_challenge_status) , path = tracing :: field :: debug (path) , challenge_data = tracing :: field :: debug (challenge_data) });
4198        }
4199        #[inline]
4200        fn on_tls_client_hello(
4201            &mut self,
4202            context: &mut Self::ConnectionContext,
4203            _meta: &api::ConnectionMeta,
4204            event: &api::TlsClientHello,
4205        ) {
4206            let id = context.id();
4207            let api::TlsClientHello { payload } = event;
4208            tracing :: event ! (target : "tls_client_hello" , parent : id , tracing :: Level :: DEBUG , { payload = tracing :: field :: debug (payload) });
4209        }
4210        #[inline]
4211        fn on_tls_server_hello(
4212            &mut self,
4213            context: &mut Self::ConnectionContext,
4214            _meta: &api::ConnectionMeta,
4215            event: &api::TlsServerHello,
4216        ) {
4217            let id = context.id();
4218            let api::TlsServerHello { payload } = event;
4219            tracing :: event ! (target : "tls_server_hello" , parent : id , tracing :: Level :: DEBUG , { payload = tracing :: field :: debug (payload) });
4220        }
4221        #[inline]
4222        fn on_rx_stream_progress(
4223            &mut self,
4224            context: &mut Self::ConnectionContext,
4225            _meta: &api::ConnectionMeta,
4226            event: &api::RxStreamProgress,
4227        ) {
4228            let id = context.id();
4229            let api::RxStreamProgress { bytes } = event;
4230            tracing :: event ! (target : "rx_stream_progress" , parent : id , tracing :: Level :: DEBUG , { bytes = tracing :: field :: debug (bytes) });
4231        }
4232        #[inline]
4233        fn on_tx_stream_progress(
4234            &mut self,
4235            context: &mut Self::ConnectionContext,
4236            _meta: &api::ConnectionMeta,
4237            event: &api::TxStreamProgress,
4238        ) {
4239            let id = context.id();
4240            let api::TxStreamProgress { bytes } = event;
4241            tracing :: event ! (target : "tx_stream_progress" , parent : id , tracing :: Level :: DEBUG , { bytes = tracing :: field :: debug (bytes) });
4242        }
4243        #[inline]
4244        fn on_keep_alive_timer_expired(
4245            &mut self,
4246            context: &mut Self::ConnectionContext,
4247            _meta: &api::ConnectionMeta,
4248            event: &api::KeepAliveTimerExpired,
4249        ) {
4250            let id = context.id();
4251            let api::KeepAliveTimerExpired { timeout } = event;
4252            tracing :: event ! (target : "keep_alive_timer_expired" , parent : id , tracing :: Level :: DEBUG , { timeout = tracing :: field :: debug (timeout) });
4253        }
4254        #[inline]
4255        fn on_mtu_updated(
4256            &mut self,
4257            context: &mut Self::ConnectionContext,
4258            _meta: &api::ConnectionMeta,
4259            event: &api::MtuUpdated,
4260        ) {
4261            let id = context.id();
4262            let api::MtuUpdated {
4263                path_id,
4264                mtu,
4265                cause,
4266                search_complete,
4267            } = event;
4268            tracing :: event ! (target : "mtu_updated" , parent : id , tracing :: Level :: DEBUG , { path_id = tracing :: field :: debug (path_id) , mtu = tracing :: field :: debug (mtu) , cause = tracing :: field :: debug (cause) , search_complete = tracing :: field :: debug (search_complete) });
4269        }
4270        #[inline]
4271        fn on_mtu_probing_complete_received(
4272            &mut self,
4273            context: &mut Self::ConnectionContext,
4274            _meta: &api::ConnectionMeta,
4275            event: &api::MtuProbingCompleteReceived,
4276        ) {
4277            let id = context.id();
4278            let api::MtuProbingCompleteReceived {
4279                packet_header,
4280                path,
4281                mtu,
4282            } = event;
4283            tracing :: event ! (target : "mtu_probing_complete_received" , parent : id , tracing :: Level :: DEBUG , { packet_header = tracing :: field :: debug (packet_header) , path = tracing :: field :: debug (path) , mtu = tracing :: field :: debug (mtu) });
4284        }
4285        #[inline]
4286        fn on_slow_start_exited(
4287            &mut self,
4288            context: &mut Self::ConnectionContext,
4289            _meta: &api::ConnectionMeta,
4290            event: &api::SlowStartExited,
4291        ) {
4292            let id = context.id();
4293            let api::SlowStartExited {
4294                path_id,
4295                cause,
4296                congestion_window,
4297            } = event;
4298            tracing :: event ! (target : "slow_start_exited" , parent : id , tracing :: Level :: DEBUG , { path_id = tracing :: field :: debug (path_id) , cause = tracing :: field :: debug (cause) , congestion_window = tracing :: field :: debug (congestion_window) });
4299        }
4300        #[inline]
4301        fn on_delivery_rate_sampled(
4302            &mut self,
4303            context: &mut Self::ConnectionContext,
4304            _meta: &api::ConnectionMeta,
4305            event: &api::DeliveryRateSampled,
4306        ) {
4307            let id = context.id();
4308            let api::DeliveryRateSampled {
4309                path_id,
4310                rate_sample,
4311            } = event;
4312            tracing :: event ! (target : "delivery_rate_sampled" , parent : id , tracing :: Level :: DEBUG , { path_id = tracing :: field :: debug (path_id) , rate_sample = tracing :: field :: debug (rate_sample) });
4313        }
4314        #[inline]
4315        fn on_pacing_rate_updated(
4316            &mut self,
4317            context: &mut Self::ConnectionContext,
4318            _meta: &api::ConnectionMeta,
4319            event: &api::PacingRateUpdated,
4320        ) {
4321            let id = context.id();
4322            let api::PacingRateUpdated {
4323                path_id,
4324                bytes_per_second,
4325                burst_size,
4326                pacing_gain,
4327            } = event;
4328            tracing :: event ! (target : "pacing_rate_updated" , parent : id , tracing :: Level :: DEBUG , { path_id = tracing :: field :: debug (path_id) , bytes_per_second = tracing :: field :: debug (bytes_per_second) , burst_size = tracing :: field :: debug (burst_size) , pacing_gain = tracing :: field :: debug (pacing_gain) });
4329        }
4330        #[inline]
4331        fn on_bbr_state_changed(
4332            &mut self,
4333            context: &mut Self::ConnectionContext,
4334            _meta: &api::ConnectionMeta,
4335            event: &api::BbrStateChanged,
4336        ) {
4337            let id = context.id();
4338            let api::BbrStateChanged { path_id, state } = event;
4339            tracing :: event ! (target : "bbr_state_changed" , parent : id , tracing :: Level :: DEBUG , { path_id = tracing :: field :: debug (path_id) , state = tracing :: field :: debug (state) });
4340        }
4341        #[inline]
4342        fn on_dc_state_changed(
4343            &mut self,
4344            context: &mut Self::ConnectionContext,
4345            _meta: &api::ConnectionMeta,
4346            event: &api::DcStateChanged,
4347        ) {
4348            let id = context.id();
4349            let api::DcStateChanged { state } = event;
4350            tracing :: event ! (target : "dc_state_changed" , parent : id , tracing :: Level :: DEBUG , { state = tracing :: field :: debug (state) });
4351        }
4352        #[inline]
4353        fn on_dc_path_created(
4354            &mut self,
4355            context: &mut Self::ConnectionContext,
4356            _meta: &api::ConnectionMeta,
4357            event: &api::DcPathCreated,
4358        ) {
4359            let id = context.id();
4360            let api::DcPathCreated { path } = event;
4361            tracing :: event ! (target : "dc_path_created" , parent : id , tracing :: Level :: DEBUG , { path = tracing :: field :: debug (path) });
4362        }
4363        #[inline]
4364        fn on_connection_closed(
4365            &mut self,
4366            context: &mut Self::ConnectionContext,
4367            _meta: &api::ConnectionMeta,
4368            event: &api::ConnectionClosed,
4369        ) {
4370            let id = context.id();
4371            let api::ConnectionClosed { error } = event;
4372            tracing :: event ! (target : "connection_closed" , parent : id , tracing :: Level :: DEBUG , { error = tracing :: field :: debug (error) });
4373        }
4374        #[inline]
4375        fn on_version_information(
4376            &mut self,
4377            meta: &api::EndpointMeta,
4378            event: &api::VersionInformation,
4379        ) {
4380            let parent = self.parent(meta);
4381            let api::VersionInformation {
4382                server_versions,
4383                client_versions,
4384                chosen_version,
4385            } = event;
4386            tracing :: event ! (target : "version_information" , parent : parent , tracing :: Level :: DEBUG , { server_versions = tracing :: field :: debug (server_versions) , client_versions = tracing :: field :: debug (client_versions) , chosen_version = tracing :: field :: debug (chosen_version) });
4387        }
4388        #[inline]
4389        fn on_endpoint_packet_sent(
4390            &mut self,
4391            meta: &api::EndpointMeta,
4392            event: &api::EndpointPacketSent,
4393        ) {
4394            let parent = self.parent(meta);
4395            let api::EndpointPacketSent { packet_header } = event;
4396            tracing :: event ! (target : "endpoint_packet_sent" , parent : parent , tracing :: Level :: DEBUG , { packet_header = tracing :: field :: debug (packet_header) });
4397        }
4398        #[inline]
4399        fn on_endpoint_packet_received(
4400            &mut self,
4401            meta: &api::EndpointMeta,
4402            event: &api::EndpointPacketReceived,
4403        ) {
4404            let parent = self.parent(meta);
4405            let api::EndpointPacketReceived { packet_header } = event;
4406            tracing :: event ! (target : "endpoint_packet_received" , parent : parent , tracing :: Level :: DEBUG , { packet_header = tracing :: field :: debug (packet_header) });
4407        }
4408        #[inline]
4409        fn on_endpoint_datagram_sent(
4410            &mut self,
4411            meta: &api::EndpointMeta,
4412            event: &api::EndpointDatagramSent,
4413        ) {
4414            let parent = self.parent(meta);
4415            let api::EndpointDatagramSent { len, gso_offset } = event;
4416            tracing :: event ! (target : "endpoint_datagram_sent" , parent : parent , tracing :: Level :: DEBUG , { len = tracing :: field :: debug (len) , gso_offset = tracing :: field :: debug (gso_offset) });
4417        }
4418        #[inline]
4419        fn on_endpoint_datagram_received(
4420            &mut self,
4421            meta: &api::EndpointMeta,
4422            event: &api::EndpointDatagramReceived,
4423        ) {
4424            let parent = self.parent(meta);
4425            let api::EndpointDatagramReceived { len } = event;
4426            tracing :: event ! (target : "endpoint_datagram_received" , parent : parent , tracing :: Level :: DEBUG , { len = tracing :: field :: debug (len) });
4427        }
4428        #[inline]
4429        fn on_endpoint_datagram_dropped(
4430            &mut self,
4431            meta: &api::EndpointMeta,
4432            event: &api::EndpointDatagramDropped,
4433        ) {
4434            let parent = self.parent(meta);
4435            let api::EndpointDatagramDropped { len, reason } = event;
4436            tracing :: event ! (target : "endpoint_datagram_dropped" , parent : parent , tracing :: Level :: DEBUG , { len = tracing :: field :: debug (len) , reason = tracing :: field :: debug (reason) });
4437        }
4438        #[inline]
4439        fn on_endpoint_connection_attempt_failed(
4440            &mut self,
4441            meta: &api::EndpointMeta,
4442            event: &api::EndpointConnectionAttemptFailed,
4443        ) {
4444            let parent = self.parent(meta);
4445            let api::EndpointConnectionAttemptFailed { error } = event;
4446            tracing :: event ! (target : "endpoint_connection_attempt_failed" , parent : parent , tracing :: Level :: DEBUG , { error = tracing :: field :: debug (error) });
4447        }
4448        #[inline]
4449        fn on_endpoint_connection_attempt_deduplicated(
4450            &mut self,
4451            meta: &api::EndpointMeta,
4452            event: &api::EndpointConnectionAttemptDeduplicated,
4453        ) {
4454            let parent = self.parent(meta);
4455            let api::EndpointConnectionAttemptDeduplicated {
4456                connection_id,
4457                already_open,
4458            } = event;
4459            tracing :: event ! (target : "endpoint_connection_attempt_deduplicated" , parent : parent , tracing :: Level :: DEBUG , { connection_id = tracing :: field :: debug (connection_id) , already_open = tracing :: field :: debug (already_open) });
4460        }
4461        #[inline]
4462        fn on_platform_tx(&mut self, meta: &api::EndpointMeta, event: &api::PlatformTx) {
4463            let parent = self.parent(meta);
4464            let api::PlatformTx {
4465                count,
4466                syscalls,
4467                blocked_syscalls,
4468                total_errors,
4469                dropped_errors,
4470            } = event;
4471            tracing :: event ! (target : "platform_tx" , parent : parent , tracing :: Level :: DEBUG , { count = tracing :: field :: debug (count) , syscalls = tracing :: field :: debug (syscalls) , blocked_syscalls = tracing :: field :: debug (blocked_syscalls) , total_errors = tracing :: field :: debug (total_errors) , dropped_errors = tracing :: field :: debug (dropped_errors) });
4472        }
4473        #[inline]
4474        fn on_platform_tx_error(&mut self, meta: &api::EndpointMeta, event: &api::PlatformTxError) {
4475            let parent = self.parent(meta);
4476            let api::PlatformTxError { errno } = event;
4477            tracing :: event ! (target : "platform_tx_error" , parent : parent , tracing :: Level :: DEBUG , { errno = tracing :: field :: debug (errno) });
4478        }
4479        #[inline]
4480        fn on_platform_rx(&mut self, meta: &api::EndpointMeta, event: &api::PlatformRx) {
4481            let parent = self.parent(meta);
4482            let api::PlatformRx {
4483                count,
4484                syscalls,
4485                blocked_syscalls,
4486                total_errors,
4487                dropped_errors,
4488            } = event;
4489            tracing :: event ! (target : "platform_rx" , parent : parent , tracing :: Level :: DEBUG , { count = tracing :: field :: debug (count) , syscalls = tracing :: field :: debug (syscalls) , blocked_syscalls = tracing :: field :: debug (blocked_syscalls) , total_errors = tracing :: field :: debug (total_errors) , dropped_errors = tracing :: field :: debug (dropped_errors) });
4490        }
4491        #[inline]
4492        fn on_platform_rx_error(&mut self, meta: &api::EndpointMeta, event: &api::PlatformRxError) {
4493            let parent = self.parent(meta);
4494            let api::PlatformRxError { errno } = event;
4495            tracing :: event ! (target : "platform_rx_error" , parent : parent , tracing :: Level :: DEBUG , { errno = tracing :: field :: debug (errno) });
4496        }
4497        #[inline]
4498        fn on_platform_feature_configured(
4499            &mut self,
4500            meta: &api::EndpointMeta,
4501            event: &api::PlatformFeatureConfigured,
4502        ) {
4503            let parent = self.parent(meta);
4504            let api::PlatformFeatureConfigured { configuration } = event;
4505            tracing :: event ! (target : "platform_feature_configured" , parent : parent , tracing :: Level :: DEBUG , { configuration = tracing :: field :: debug (configuration) });
4506        }
4507        #[inline]
4508        fn on_platform_event_loop_wakeup(
4509            &mut self,
4510            meta: &api::EndpointMeta,
4511            event: &api::PlatformEventLoopWakeup,
4512        ) {
4513            let parent = self.parent(meta);
4514            let api::PlatformEventLoopWakeup {
4515                timeout_expired,
4516                rx_ready,
4517                tx_ready,
4518                application_wakeup,
4519            } = event;
4520            tracing :: event ! (target : "platform_event_loop_wakeup" , parent : parent , tracing :: Level :: DEBUG , { timeout_expired = tracing :: field :: debug (timeout_expired) , rx_ready = tracing :: field :: debug (rx_ready) , tx_ready = tracing :: field :: debug (tx_ready) , application_wakeup = tracing :: field :: debug (application_wakeup) });
4521        }
4522        #[inline]
4523        fn on_platform_event_loop_sleep(
4524            &mut self,
4525            meta: &api::EndpointMeta,
4526            event: &api::PlatformEventLoopSleep,
4527        ) {
4528            let parent = self.parent(meta);
4529            let api::PlatformEventLoopSleep {
4530                timeout,
4531                processing_duration,
4532            } = event;
4533            tracing :: event ! (target : "platform_event_loop_sleep" , parent : parent , tracing :: Level :: DEBUG , { timeout = tracing :: field :: debug (timeout) , processing_duration = tracing :: field :: debug (processing_duration) });
4534        }
4535        #[inline]
4536        fn on_platform_event_loop_started(
4537            &mut self,
4538            meta: &api::EndpointMeta,
4539            event: &api::PlatformEventLoopStarted,
4540        ) {
4541            let parent = self.parent(meta);
4542            let api::PlatformEventLoopStarted { local_address } = event;
4543            tracing :: event ! (target : "platform_event_loop_started" , parent : parent , tracing :: Level :: DEBUG , { local_address = tracing :: field :: debug (local_address) });
4544        }
4545    }
4546}
4547pub mod builder {
4548    use super::*;
4549    #[derive(Clone, Debug)]
4550    pub struct ConnectionMeta {
4551        pub endpoint_type: crate::endpoint::Type,
4552        pub id: u64,
4553        pub timestamp: crate::time::Timestamp,
4554    }
4555    impl IntoEvent<api::ConnectionMeta> for ConnectionMeta {
4556        #[inline]
4557        fn into_event(self) -> api::ConnectionMeta {
4558            let ConnectionMeta {
4559                endpoint_type,
4560                id,
4561                timestamp,
4562            } = self;
4563            api::ConnectionMeta {
4564                endpoint_type: endpoint_type.into_event(),
4565                id: id.into_event(),
4566                timestamp: timestamp.into_event(),
4567            }
4568        }
4569    }
4570    #[derive(Clone, Debug)]
4571    pub struct EndpointMeta {
4572        pub endpoint_type: crate::endpoint::Type,
4573        pub timestamp: crate::time::Timestamp,
4574    }
4575    impl IntoEvent<api::EndpointMeta> for EndpointMeta {
4576        #[inline]
4577        fn into_event(self) -> api::EndpointMeta {
4578            let EndpointMeta {
4579                endpoint_type,
4580                timestamp,
4581            } = self;
4582            api::EndpointMeta {
4583                endpoint_type: endpoint_type.into_event(),
4584                timestamp: timestamp.into_event(),
4585            }
4586        }
4587    }
4588    #[derive(Clone, Debug)]
4589    pub struct ConnectionInfo<'a> {
4590        pub application: Option<&'a (dyn core::any::Any + Send + Sync)>,
4591    }
4592    impl<'a> IntoEvent<api::ConnectionInfo<'a>> for ConnectionInfo<'a> {
4593        #[inline]
4594        fn into_event(self) -> api::ConnectionInfo<'a> {
4595            let ConnectionInfo { application } = self;
4596            api::ConnectionInfo {
4597                application: application.into_event(),
4598            }
4599        }
4600    }
4601    #[derive(Clone, Debug)]
4602    pub struct TransportParameters<'a> {
4603        pub original_destination_connection_id: Option<ConnectionId<'a>>,
4604        pub initial_source_connection_id: Option<ConnectionId<'a>>,
4605        pub retry_source_connection_id: Option<ConnectionId<'a>>,
4606        pub stateless_reset_token: Option<&'a [u8]>,
4607        pub preferred_address: Option<PreferredAddress<'a>>,
4608        pub migration_support: bool,
4609        pub max_idle_timeout: Duration,
4610        pub ack_delay_exponent: u8,
4611        pub max_ack_delay: Duration,
4612        pub max_udp_payload_size: u64,
4613        pub active_connection_id_limit: u64,
4614        pub initial_max_stream_data_bidi_local: u64,
4615        pub initial_max_stream_data_bidi_remote: u64,
4616        pub initial_max_stream_data_uni: u64,
4617        pub initial_max_streams_bidi: u64,
4618        pub initial_max_streams_uni: u64,
4619        pub max_datagram_frame_size: u64,
4620        pub dc_supported_versions: &'a [u32],
4621        pub mtu_probing_complete_support: bool,
4622    }
4623    impl<'a> IntoEvent<api::TransportParameters<'a>> for TransportParameters<'a> {
4624        #[inline]
4625        fn into_event(self) -> api::TransportParameters<'a> {
4626            let TransportParameters {
4627                original_destination_connection_id,
4628                initial_source_connection_id,
4629                retry_source_connection_id,
4630                stateless_reset_token,
4631                preferred_address,
4632                migration_support,
4633                max_idle_timeout,
4634                ack_delay_exponent,
4635                max_ack_delay,
4636                max_udp_payload_size,
4637                active_connection_id_limit,
4638                initial_max_stream_data_bidi_local,
4639                initial_max_stream_data_bidi_remote,
4640                initial_max_stream_data_uni,
4641                initial_max_streams_bidi,
4642                initial_max_streams_uni,
4643                max_datagram_frame_size,
4644                dc_supported_versions,
4645                mtu_probing_complete_support,
4646            } = self;
4647            api::TransportParameters {
4648                original_destination_connection_id: original_destination_connection_id.into_event(),
4649                initial_source_connection_id: initial_source_connection_id.into_event(),
4650                retry_source_connection_id: retry_source_connection_id.into_event(),
4651                stateless_reset_token: stateless_reset_token.into_event(),
4652                preferred_address: preferred_address.into_event(),
4653                migration_support: migration_support.into_event(),
4654                max_idle_timeout: max_idle_timeout.into_event(),
4655                ack_delay_exponent: ack_delay_exponent.into_event(),
4656                max_ack_delay: max_ack_delay.into_event(),
4657                max_udp_payload_size: max_udp_payload_size.into_event(),
4658                active_connection_id_limit: active_connection_id_limit.into_event(),
4659                initial_max_stream_data_bidi_local: initial_max_stream_data_bidi_local.into_event(),
4660                initial_max_stream_data_bidi_remote: initial_max_stream_data_bidi_remote
4661                    .into_event(),
4662                initial_max_stream_data_uni: initial_max_stream_data_uni.into_event(),
4663                initial_max_streams_bidi: initial_max_streams_bidi.into_event(),
4664                initial_max_streams_uni: initial_max_streams_uni.into_event(),
4665                max_datagram_frame_size: max_datagram_frame_size.into_event(),
4666                dc_supported_versions: dc_supported_versions.into_event(),
4667                mtu_probing_complete_support: mtu_probing_complete_support.into_event(),
4668            }
4669        }
4670    }
4671    #[derive(Clone, Debug)]
4672    pub struct PreferredAddress<'a> {
4673        pub ipv4_address: Option<SocketAddress<'a>>,
4674        pub ipv6_address: Option<SocketAddress<'a>>,
4675        pub connection_id: ConnectionId<'a>,
4676        pub stateless_reset_token: &'a [u8],
4677    }
4678    impl<'a> IntoEvent<api::PreferredAddress<'a>> for PreferredAddress<'a> {
4679        #[inline]
4680        fn into_event(self) -> api::PreferredAddress<'a> {
4681            let PreferredAddress {
4682                ipv4_address,
4683                ipv6_address,
4684                connection_id,
4685                stateless_reset_token,
4686            } = self;
4687            api::PreferredAddress {
4688                ipv4_address: ipv4_address.into_event(),
4689                ipv6_address: ipv6_address.into_event(),
4690                connection_id: connection_id.into_event(),
4691                stateless_reset_token: stateless_reset_token.into_event(),
4692            }
4693        }
4694    }
4695    #[derive(Copy, Clone, Debug)]
4696    pub struct Path<'a> {
4697        pub local_addr: SocketAddress<'a>,
4698        pub local_cid: ConnectionId<'a>,
4699        pub remote_addr: SocketAddress<'a>,
4700        pub remote_cid: ConnectionId<'a>,
4701        pub id: u64,
4702        pub is_active: bool,
4703    }
4704    impl<'a> IntoEvent<api::Path<'a>> for Path<'a> {
4705        #[inline]
4706        fn into_event(self) -> api::Path<'a> {
4707            let Path {
4708                local_addr,
4709                local_cid,
4710                remote_addr,
4711                remote_cid,
4712                id,
4713                is_active,
4714            } = self;
4715            api::Path {
4716                local_addr: local_addr.into_event(),
4717                local_cid: local_cid.into_event(),
4718                remote_addr: remote_addr.into_event(),
4719                remote_cid: remote_cid.into_event(),
4720                id: id.into_event(),
4721                is_active: is_active.into_event(),
4722            }
4723        }
4724    }
4725    #[derive(Copy, Clone, Debug)]
4726    pub struct ConnectionId<'a> {
4727        pub bytes: &'a [u8],
4728    }
4729    impl<'a> IntoEvent<api::ConnectionId<'a>> for ConnectionId<'a> {
4730        #[inline]
4731        fn into_event(self) -> api::ConnectionId<'a> {
4732            let ConnectionId { bytes } = self;
4733            api::ConnectionId {
4734                bytes: bytes.into_event(),
4735            }
4736        }
4737    }
4738    #[derive(Clone, Debug)]
4739    pub struct EcnCounts {
4740        #[doc = " A variable-length integer representing the total number of packets"]
4741        #[doc = " received with the ECT(0) codepoint."]
4742        pub ect_0_count: u64,
4743        #[doc = " A variable-length integer representing the total number of packets"]
4744        #[doc = " received with the ECT(1) codepoint."]
4745        pub ect_1_count: u64,
4746        #[doc = " A variable-length integer representing the total number of packets"]
4747        #[doc = " received with the CE codepoint."]
4748        pub ce_count: u64,
4749    }
4750    impl IntoEvent<api::EcnCounts> for EcnCounts {
4751        #[inline]
4752        fn into_event(self) -> api::EcnCounts {
4753            let EcnCounts {
4754                ect_0_count,
4755                ect_1_count,
4756                ce_count,
4757            } = self;
4758            api::EcnCounts {
4759                ect_0_count: ect_0_count.into_event(),
4760                ect_1_count: ect_1_count.into_event(),
4761                ce_count: ce_count.into_event(),
4762            }
4763        }
4764    }
4765    #[derive(Clone, Debug)]
4766    pub struct ConnectionCloseFrame<'a> {
4767        pub error_code: u64,
4768        pub frame_type: Option<u64>,
4769        pub reason: Option<&'a [u8]>,
4770    }
4771    impl<'a> IntoEvent<api::ConnectionCloseFrame<'a>> for ConnectionCloseFrame<'a> {
4772        #[inline]
4773        fn into_event(self) -> api::ConnectionCloseFrame<'a> {
4774            let ConnectionCloseFrame {
4775                error_code,
4776                frame_type,
4777                reason,
4778            } = self;
4779            api::ConnectionCloseFrame {
4780                error_code: error_code.into_event(),
4781                frame_type: frame_type.into_event(),
4782                reason: reason.into_event(),
4783            }
4784        }
4785    }
4786    #[derive(Clone, Debug)]
4787    pub struct MtuConfig {
4788        pub initial_mtu: u16,
4789        pub base_mtu: u16,
4790        pub max_mtu: u16,
4791    }
4792    impl IntoEvent<api::MtuConfig> for MtuConfig {
4793        #[inline]
4794        fn into_event(self) -> api::MtuConfig {
4795            let MtuConfig {
4796                initial_mtu,
4797                base_mtu,
4798                max_mtu,
4799            } = self;
4800            api::MtuConfig {
4801                initial_mtu: initial_mtu.into_event(),
4802                base_mtu: base_mtu.into_event(),
4803                max_mtu: max_mtu.into_event(),
4804            }
4805        }
4806    }
4807    #[derive(Clone, Debug)]
4808    #[doc = " A bandwidth delivery rate estimate with associated metadata"]
4809    pub struct RateSample {
4810        #[doc = " The length of the sampling interval"]
4811        pub interval: Duration,
4812        #[doc = " The amount of data in bytes marked as delivered over the sampling interval"]
4813        pub delivered_bytes: u64,
4814        #[doc = " The amount of data in bytes marked as lost over the sampling interval"]
4815        pub lost_bytes: u64,
4816        #[doc = " The number of packets marked as explicit congestion experienced over the sampling interval"]
4817        pub ecn_ce_count: u64,
4818        #[doc = " PacketInfo::is_app_limited from the most recent acknowledged packet"]
4819        pub is_app_limited: bool,
4820        #[doc = " PacketInfo::delivered_bytes from the most recent acknowledged packet"]
4821        pub prior_delivered_bytes: u64,
4822        #[doc = " PacketInfo::bytes_in_flight from the most recent acknowledged packet"]
4823        pub bytes_in_flight: u32,
4824        #[doc = " PacketInfo::lost_bytes from the most recent acknowledged packet"]
4825        pub prior_lost_bytes: u64,
4826        #[doc = " PacketInfo::ecn_ce_count from the most recent acknowledged packet"]
4827        pub prior_ecn_ce_count: u64,
4828        #[doc = " The delivery rate for this rate sample"]
4829        pub delivery_rate_bytes_per_second: u64,
4830    }
4831    impl IntoEvent<api::RateSample> for RateSample {
4832        #[inline]
4833        fn into_event(self) -> api::RateSample {
4834            let RateSample {
4835                interval,
4836                delivered_bytes,
4837                lost_bytes,
4838                ecn_ce_count,
4839                is_app_limited,
4840                prior_delivered_bytes,
4841                bytes_in_flight,
4842                prior_lost_bytes,
4843                prior_ecn_ce_count,
4844                delivery_rate_bytes_per_second,
4845            } = self;
4846            api::RateSample {
4847                interval: interval.into_event(),
4848                delivered_bytes: delivered_bytes.into_event(),
4849                lost_bytes: lost_bytes.into_event(),
4850                ecn_ce_count: ecn_ce_count.into_event(),
4851                is_app_limited: is_app_limited.into_event(),
4852                prior_delivered_bytes: prior_delivered_bytes.into_event(),
4853                bytes_in_flight: bytes_in_flight.into_event(),
4854                prior_lost_bytes: prior_lost_bytes.into_event(),
4855                prior_ecn_ce_count: prior_ecn_ce_count.into_event(),
4856                delivery_rate_bytes_per_second: delivery_rate_bytes_per_second.into_event(),
4857            }
4858        }
4859    }
4860    #[derive(Copy, Clone, Debug)]
4861    pub enum SocketAddress<'a> {
4862        IpV4 { ip: &'a [u8; 4], port: u16 },
4863        IpV6 { ip: &'a [u8; 16], port: u16 },
4864    }
4865    impl<'a> IntoEvent<api::SocketAddress<'a>> for SocketAddress<'a> {
4866        #[inline]
4867        fn into_event(self) -> api::SocketAddress<'a> {
4868            use api::SocketAddress::*;
4869            match self {
4870                Self::IpV4 { ip, port } => IpV4 {
4871                    ip: ip.into_event(),
4872                    port: port.into_event(),
4873                },
4874                Self::IpV6 { ip, port } => IpV6 {
4875                    ip: ip.into_event(),
4876                    port: port.into_event(),
4877                },
4878            }
4879        }
4880    }
4881    #[derive(Clone, Debug)]
4882    pub enum DuplicatePacketError {
4883        #[doc = " The packet number was already received and is a duplicate."]
4884        Duplicate,
4885        #[doc = " The received packet number was outside the range of tracked packet numbers."]
4886        #[doc = ""]
4887        #[doc = " This can happen when packets are heavily delayed or reordered. Currently, the maximum"]
4888        #[doc = " amount of reordering is limited to 128 packets. For example, if packet number `142`"]
4889        #[doc = " is received, the allowed range would be limited to `14-142`. If an endpoint received"]
4890        #[doc = " packet `< 14`, it would trigger this event."]
4891        TooOld,
4892    }
4893    impl IntoEvent<api::DuplicatePacketError> for DuplicatePacketError {
4894        #[inline]
4895        fn into_event(self) -> api::DuplicatePacketError {
4896            use api::DuplicatePacketError::*;
4897            match self {
4898                Self::Duplicate => Duplicate {},
4899                Self::TooOld => TooOld {},
4900            }
4901        }
4902    }
4903    #[derive(Clone, Debug)]
4904    pub enum Frame {
4905        Padding,
4906        Ping,
4907        Ack {
4908            ecn_counts: Option<EcnCounts>,
4909            largest_acknowledged: u64,
4910            ack_range_count: u64,
4911        },
4912        ResetStream {
4913            id: u64,
4914            error_code: u64,
4915            final_size: u64,
4916        },
4917        StopSending {
4918            id: u64,
4919            error_code: u64,
4920        },
4921        Crypto {
4922            offset: u64,
4923            len: u16,
4924        },
4925        NewToken,
4926        Stream {
4927            id: u64,
4928            offset: u64,
4929            len: u16,
4930            is_fin: bool,
4931        },
4932        MaxData {
4933            value: u64,
4934        },
4935        MaxStreamData {
4936            stream_type: StreamType,
4937            id: u64,
4938            value: u64,
4939        },
4940        MaxStreams {
4941            stream_type: StreamType,
4942            value: u64,
4943        },
4944        DataBlocked {
4945            data_limit: u64,
4946        },
4947        StreamDataBlocked {
4948            stream_id: u64,
4949            stream_data_limit: u64,
4950        },
4951        StreamsBlocked {
4952            stream_type: StreamType,
4953            stream_limit: u64,
4954        },
4955        NewConnectionId {
4956            sequence_number: u64,
4957            retire_prior_to: u64,
4958        },
4959        RetireConnectionId,
4960        PathChallenge,
4961        PathResponse,
4962        ConnectionClose,
4963        HandshakeDone,
4964        Datagram {
4965            len: u16,
4966        },
4967        DcStatelessResetTokens,
4968        MtuProbingComplete {
4969            mtu: u16,
4970        },
4971    }
4972    impl IntoEvent<api::Frame> for Frame {
4973        #[inline]
4974        fn into_event(self) -> api::Frame {
4975            use api::Frame::*;
4976            match self {
4977                Self::Padding => Padding {},
4978                Self::Ping => Ping {},
4979                Self::Ack {
4980                    ecn_counts,
4981                    largest_acknowledged,
4982                    ack_range_count,
4983                } => Ack {
4984                    ecn_counts: ecn_counts.into_event(),
4985                    largest_acknowledged: largest_acknowledged.into_event(),
4986                    ack_range_count: ack_range_count.into_event(),
4987                },
4988                Self::ResetStream {
4989                    id,
4990                    error_code,
4991                    final_size,
4992                } => ResetStream {
4993                    id: id.into_event(),
4994                    error_code: error_code.into_event(),
4995                    final_size: final_size.into_event(),
4996                },
4997                Self::StopSending { id, error_code } => StopSending {
4998                    id: id.into_event(),
4999                    error_code: error_code.into_event(),
5000                },
5001                Self::Crypto { offset, len } => Crypto {
5002                    offset: offset.into_event(),
5003                    len: len.into_event(),
5004                },
5005                Self::NewToken => NewToken {},
5006                Self::Stream {
5007                    id,
5008                    offset,
5009                    len,
5010                    is_fin,
5011                } => Stream {
5012                    id: id.into_event(),
5013                    offset: offset.into_event(),
5014                    len: len.into_event(),
5015                    is_fin: is_fin.into_event(),
5016                },
5017                Self::MaxData { value } => MaxData {
5018                    value: value.into_event(),
5019                },
5020                Self::MaxStreamData {
5021                    stream_type,
5022                    id,
5023                    value,
5024                } => MaxStreamData {
5025                    stream_type: stream_type.into_event(),
5026                    id: id.into_event(),
5027                    value: value.into_event(),
5028                },
5029                Self::MaxStreams { stream_type, value } => MaxStreams {
5030                    stream_type: stream_type.into_event(),
5031                    value: value.into_event(),
5032                },
5033                Self::DataBlocked { data_limit } => DataBlocked {
5034                    data_limit: data_limit.into_event(),
5035                },
5036                Self::StreamDataBlocked {
5037                    stream_id,
5038                    stream_data_limit,
5039                } => StreamDataBlocked {
5040                    stream_id: stream_id.into_event(),
5041                    stream_data_limit: stream_data_limit.into_event(),
5042                },
5043                Self::StreamsBlocked {
5044                    stream_type,
5045                    stream_limit,
5046                } => StreamsBlocked {
5047                    stream_type: stream_type.into_event(),
5048                    stream_limit: stream_limit.into_event(),
5049                },
5050                Self::NewConnectionId {
5051                    sequence_number,
5052                    retire_prior_to,
5053                } => NewConnectionId {
5054                    sequence_number: sequence_number.into_event(),
5055                    retire_prior_to: retire_prior_to.into_event(),
5056                },
5057                Self::RetireConnectionId => RetireConnectionId {},
5058                Self::PathChallenge => PathChallenge {},
5059                Self::PathResponse => PathResponse {},
5060                Self::ConnectionClose => ConnectionClose {},
5061                Self::HandshakeDone => HandshakeDone {},
5062                Self::Datagram { len } => Datagram {
5063                    len: len.into_event(),
5064                },
5065                Self::DcStatelessResetTokens => DcStatelessResetTokens {},
5066                Self::MtuProbingComplete { mtu } => MtuProbingComplete {
5067                    mtu: mtu.into_event(),
5068                },
5069            }
5070        }
5071    }
5072    #[derive(Clone, Debug)]
5073    pub enum StreamType {
5074        Bidirectional,
5075        Unidirectional,
5076    }
5077    impl IntoEvent<api::StreamType> for StreamType {
5078        #[inline]
5079        fn into_event(self) -> api::StreamType {
5080            use api::StreamType::*;
5081            match self {
5082                Self::Bidirectional => Bidirectional {},
5083                Self::Unidirectional => Unidirectional {},
5084            }
5085        }
5086    }
5087    #[derive(Clone, Debug)]
5088    pub enum PacketHeader {
5089        Initial { number: u64, version: u32 },
5090        Handshake { number: u64, version: u32 },
5091        ZeroRtt { number: u64, version: u32 },
5092        OneRtt { number: u64 },
5093        Retry { version: u32 },
5094        VersionNegotiation,
5095        StatelessReset,
5096    }
5097    impl IntoEvent<api::PacketHeader> for PacketHeader {
5098        #[inline]
5099        fn into_event(self) -> api::PacketHeader {
5100            use api::PacketHeader::*;
5101            match self {
5102                Self::Initial { number, version } => Initial {
5103                    number: number.into_event(),
5104                    version: version.into_event(),
5105                },
5106                Self::Handshake { number, version } => Handshake {
5107                    number: number.into_event(),
5108                    version: version.into_event(),
5109                },
5110                Self::ZeroRtt { number, version } => ZeroRtt {
5111                    number: number.into_event(),
5112                    version: version.into_event(),
5113                },
5114                Self::OneRtt { number } => OneRtt {
5115                    number: number.into_event(),
5116                },
5117                Self::Retry { version } => Retry {
5118                    version: version.into_event(),
5119                },
5120                Self::VersionNegotiation => VersionNegotiation {},
5121                Self::StatelessReset => StatelessReset {},
5122            }
5123        }
5124    }
5125    #[derive(Clone, Debug)]
5126    pub enum PacketType {
5127        Initial,
5128        Handshake,
5129        ZeroRtt,
5130        OneRtt,
5131        Retry,
5132        VersionNegotiation,
5133        StatelessReset,
5134    }
5135    impl IntoEvent<api::PacketType> for PacketType {
5136        #[inline]
5137        fn into_event(self) -> api::PacketType {
5138            use api::PacketType::*;
5139            match self {
5140                Self::Initial => Initial {},
5141                Self::Handshake => Handshake {},
5142                Self::ZeroRtt => ZeroRtt {},
5143                Self::OneRtt => OneRtt {},
5144                Self::Retry => Retry {},
5145                Self::VersionNegotiation => VersionNegotiation {},
5146                Self::StatelessReset => StatelessReset {},
5147            }
5148        }
5149    }
5150    #[derive(Clone, Debug)]
5151    pub enum KeyType {
5152        Initial,
5153        Handshake,
5154        ZeroRtt,
5155        OneRtt { generation: u16 },
5156    }
5157    impl IntoEvent<api::KeyType> for KeyType {
5158        #[inline]
5159        fn into_event(self) -> api::KeyType {
5160            use api::KeyType::*;
5161            match self {
5162                Self::Initial => Initial {},
5163                Self::Handshake => Handshake {},
5164                Self::ZeroRtt => ZeroRtt {},
5165                Self::OneRtt { generation } => OneRtt {
5166                    generation: generation.into_event(),
5167                },
5168            }
5169        }
5170    }
5171    #[derive(Clone, Debug)]
5172    #[doc = " A context from which the event is being emitted"]
5173    #[doc = ""]
5174    #[doc = " An event can occur in the context of an Endpoint or Connection"]
5175    pub enum Subject {
5176        Endpoint,
5177        #[doc = " This maps to an internal connection id, which is a stable identifier across CID changes."]
5178        Connection {
5179            id: u64,
5180        },
5181    }
5182    impl IntoEvent<api::Subject> for Subject {
5183        #[inline]
5184        fn into_event(self) -> api::Subject {
5185            use api::Subject::*;
5186            match self {
5187                Self::Endpoint => Endpoint {},
5188                Self::Connection { id } => Connection {
5189                    id: id.into_event(),
5190                },
5191            }
5192        }
5193    }
5194    #[derive(Clone, Debug)]
5195    #[doc = " An endpoint may be either a Server or a Client"]
5196    pub enum EndpointType {
5197        Server,
5198        Client,
5199    }
5200    impl IntoEvent<api::EndpointType> for EndpointType {
5201        #[inline]
5202        fn into_event(self) -> api::EndpointType {
5203            use api::EndpointType::*;
5204            match self {
5205                Self::Server => Server {},
5206                Self::Client => Client {},
5207            }
5208        }
5209    }
5210    #[derive(Clone, Debug)]
5211    pub enum DatagramDropReason {
5212        #[doc = " There was an error while attempting to decode the datagram."]
5213        DecodingFailed,
5214        #[doc = " There was an error while parsing the Retry token."]
5215        InvalidRetryToken,
5216        #[doc = " The peer specified an unsupported QUIC version."]
5217        UnsupportedVersion,
5218        #[doc = " The peer sent an invalid Destination Connection Id."]
5219        InvalidDestinationConnectionId,
5220        #[doc = " The peer sent an invalid Source Connection Id."]
5221        InvalidSourceConnectionId,
5222        #[doc = " Application provided invalid MTU configuration."]
5223        InvalidMtuConfiguration {
5224            #[doc = " MTU configuration for the endpoint"]
5225            endpoint_mtu_config: MtuConfig,
5226        },
5227        #[doc = " The Destination Connection Id is unknown and does not map to a Connection."]
5228        #[doc = ""]
5229        #[doc = " Connections are mapped to Destination Connections Ids (DCID) and packets"]
5230        #[doc = " in a Datagram are routed to a connection based on the DCID in the first"]
5231        #[doc = " packet. If a Connection is not found for the specified DCID then the"]
5232        #[doc = " datagram can not be processed and is dropped."]
5233        UnknownDestinationConnectionId,
5234        #[doc = " The connection attempt was rejected."]
5235        RejectedConnectionAttempt,
5236        #[doc = " A datagram was received from an unknown server address."]
5237        UnknownServerAddress,
5238        #[doc = " The peer initiated a connection migration before the handshake was confirmed."]
5239        #[doc = ""]
5240        #[doc = " Note: This drop reason is no longer emitted"]
5241        ConnectionMigrationDuringHandshake,
5242        #[doc = " The attempted connection migration was rejected."]
5243        RejectedConnectionMigration { reason: MigrationDenyReason },
5244        #[doc = " The maximum number of paths per connection was exceeded."]
5245        PathLimitExceeded,
5246        #[doc = " The peer initiated a connection migration without supplying enough connection IDs to use."]
5247        #[doc = ""]
5248        #[doc = " Note: This drop reason is no longer emitted"]
5249        InsufficientConnectionIds,
5250    }
5251    impl IntoEvent<api::DatagramDropReason> for DatagramDropReason {
5252        #[inline]
5253        fn into_event(self) -> api::DatagramDropReason {
5254            use api::DatagramDropReason::*;
5255            match self {
5256                Self::DecodingFailed => DecodingFailed {},
5257                Self::InvalidRetryToken => InvalidRetryToken {},
5258                Self::UnsupportedVersion => UnsupportedVersion {},
5259                Self::InvalidDestinationConnectionId => InvalidDestinationConnectionId {},
5260                Self::InvalidSourceConnectionId => InvalidSourceConnectionId {},
5261                Self::InvalidMtuConfiguration {
5262                    endpoint_mtu_config,
5263                } => InvalidMtuConfiguration {
5264                    endpoint_mtu_config: endpoint_mtu_config.into_event(),
5265                },
5266                Self::UnknownDestinationConnectionId => UnknownDestinationConnectionId {},
5267                Self::RejectedConnectionAttempt => RejectedConnectionAttempt {},
5268                Self::UnknownServerAddress => UnknownServerAddress {},
5269                Self::ConnectionMigrationDuringHandshake => ConnectionMigrationDuringHandshake {},
5270                Self::RejectedConnectionMigration { reason } => RejectedConnectionMigration {
5271                    reason: reason.into_event(),
5272                },
5273                Self::PathLimitExceeded => PathLimitExceeded {},
5274                Self::InsufficientConnectionIds => InsufficientConnectionIds {},
5275            }
5276        }
5277    }
5278    #[derive(Clone, Debug)]
5279    pub enum KeySpace {
5280        Initial,
5281        Handshake,
5282        ZeroRtt,
5283        OneRtt,
5284    }
5285    impl IntoEvent<api::KeySpace> for KeySpace {
5286        #[inline]
5287        fn into_event(self) -> api::KeySpace {
5288            use api::KeySpace::*;
5289            match self {
5290                Self::Initial => Initial {},
5291                Self::Handshake => Handshake {},
5292                Self::ZeroRtt => ZeroRtt {},
5293                Self::OneRtt => OneRtt {},
5294            }
5295        }
5296    }
5297    #[derive(Clone, Debug)]
5298    pub enum PacketSkipReason {
5299        #[doc = " Skipped a packet number to elicit a quicker PTO acknowledgment"]
5300        PtoProbe,
5301        #[doc = " Skipped a packet number to detect an Optimistic Ack attack"]
5302        OptimisticAckMitigation,
5303    }
5304    impl IntoEvent<api::PacketSkipReason> for PacketSkipReason {
5305        #[inline]
5306        fn into_event(self) -> api::PacketSkipReason {
5307            use api::PacketSkipReason::*;
5308            match self {
5309                Self::PtoProbe => PtoProbe {},
5310                Self::OptimisticAckMitigation => OptimisticAckMitigation {},
5311            }
5312        }
5313    }
5314    #[derive(Clone, Debug)]
5315    pub enum PacketDropReason<'a> {
5316        #[doc = " A connection error occurred and is no longer able to process packets."]
5317        ConnectionError { path: Path<'a> },
5318        #[doc = " The handshake needed to be complete before processing the packet."]
5319        #[doc = ""]
5320        #[doc = " To ensure the connection stays secure, short packets can only be processed"]
5321        #[doc = " once the handshake has completed."]
5322        HandshakeNotComplete { path: Path<'a> },
5323        #[doc = " The packet contained a version which did not match the version negotiated"]
5324        #[doc = " during the handshake."]
5325        VersionMismatch { version: u32, path: Path<'a> },
5326        #[doc = " A datagram contained more than one destination connection ID, which is"]
5327        #[doc = " not allowed."]
5328        ConnectionIdMismatch {
5329            packet_cid: &'a [u8],
5330            path: Path<'a>,
5331        },
5332        #[doc = " There was a failure when attempting to remove header protection."]
5333        UnprotectFailed { space: KeySpace, path: Path<'a> },
5334        #[doc = " There was a failure when attempting to decrypt the packet."]
5335        DecryptionFailed {
5336            path: Path<'a>,
5337            packet_header: PacketHeader,
5338        },
5339        #[doc = " Packet decoding failed."]
5340        #[doc = ""]
5341        #[doc = " The payload is decoded one packet at a time. If decoding fails"]
5342        #[doc = " then the remaining packets are also discarded."]
5343        DecodingFailed { path: Path<'a> },
5344        #[doc = " The client received a non-empty retry token."]
5345        NonEmptyRetryToken { path: Path<'a> },
5346        #[doc = " A Retry packet was discarded."]
5347        RetryDiscarded {
5348            reason: RetryDiscardReason<'a>,
5349            path: Path<'a>,
5350        },
5351        #[doc = " The received Initial packet was not transported in a datagram of at least 1200 bytes"]
5352        UndersizedInitialPacket { path: Path<'a> },
5353        #[doc = " The destination connection ID in the packet was the initial connection ID but was in"]
5354        #[doc = " a non-initial packet."]
5355        InitialConnectionIdInvalidSpace {
5356            path: Path<'a>,
5357            packet_type: PacketType,
5358        },
5359        #[doc = " The packet space for a received packet did not exist"]
5360        PacketSpaceDoesNotExist {
5361            path: Path<'a>,
5362            packet_type: PacketType,
5363        },
5364    }
5365    impl<'a> IntoEvent<api::PacketDropReason<'a>> for PacketDropReason<'a> {
5366        #[inline]
5367        fn into_event(self) -> api::PacketDropReason<'a> {
5368            use api::PacketDropReason::*;
5369            match self {
5370                Self::ConnectionError { path } => ConnectionError {
5371                    path: path.into_event(),
5372                },
5373                Self::HandshakeNotComplete { path } => HandshakeNotComplete {
5374                    path: path.into_event(),
5375                },
5376                Self::VersionMismatch { version, path } => VersionMismatch {
5377                    version: version.into_event(),
5378                    path: path.into_event(),
5379                },
5380                Self::ConnectionIdMismatch { packet_cid, path } => ConnectionIdMismatch {
5381                    packet_cid: packet_cid.into_event(),
5382                    path: path.into_event(),
5383                },
5384                Self::UnprotectFailed { space, path } => UnprotectFailed {
5385                    space: space.into_event(),
5386                    path: path.into_event(),
5387                },
5388                Self::DecryptionFailed {
5389                    path,
5390                    packet_header,
5391                } => DecryptionFailed {
5392                    path: path.into_event(),
5393                    packet_header: packet_header.into_event(),
5394                },
5395                Self::DecodingFailed { path } => DecodingFailed {
5396                    path: path.into_event(),
5397                },
5398                Self::NonEmptyRetryToken { path } => NonEmptyRetryToken {
5399                    path: path.into_event(),
5400                },
5401                Self::RetryDiscarded { reason, path } => RetryDiscarded {
5402                    reason: reason.into_event(),
5403                    path: path.into_event(),
5404                },
5405                Self::UndersizedInitialPacket { path } => UndersizedInitialPacket {
5406                    path: path.into_event(),
5407                },
5408                Self::InitialConnectionIdInvalidSpace { path, packet_type } => {
5409                    InitialConnectionIdInvalidSpace {
5410                        path: path.into_event(),
5411                        packet_type: packet_type.into_event(),
5412                    }
5413                }
5414                Self::PacketSpaceDoesNotExist { path, packet_type } => PacketSpaceDoesNotExist {
5415                    path: path.into_event(),
5416                    packet_type: packet_type.into_event(),
5417                },
5418            }
5419        }
5420    }
5421    #[derive(Clone, Debug)]
5422    pub enum AckAction {
5423        #[doc = " Ack range for received packets was dropped due to space constraints"]
5424        #[doc = ""]
5425        #[doc = " For the purpose of processing Acks, RX packet numbers are stored as"]
5426        #[doc = " packet_number ranges in an IntervalSet; only lower and upper bounds"]
5427        #[doc = " are stored instead of individual packet_numbers. Ranges are merged"]
5428        #[doc = " when possible so only disjointed ranges are stored."]
5429        #[doc = ""]
5430        #[doc = " When at `capacity`, the lowest packet_number range is dropped."]
5431        RxAckRangeDropped {
5432            #[doc = " The packet number range which was dropped"]
5433            packet_number_range: core::ops::RangeInclusive<u64>,
5434            #[doc = " The number of disjoint ranges the IntervalSet can store"]
5435            capacity: usize,
5436            #[doc = " The store packet_number range in the IntervalSet"]
5437            stored_range: core::ops::RangeInclusive<u64>,
5438        },
5439    }
5440    #[allow(deprecated)]
5441    impl IntoEvent<api::AckAction> for AckAction {
5442        #[inline]
5443        fn into_event(self) -> api::AckAction {
5444            use api::AckAction::*;
5445            match self {
5446                Self::RxAckRangeDropped {
5447                    packet_number_range,
5448                    capacity,
5449                    stored_range,
5450                } => RxAckRangeDropped {
5451                    packet_number_range: packet_number_range.into_event(),
5452                    capacity: capacity.into_event(),
5453                    stored_range: stored_range.into_event(),
5454                },
5455            }
5456        }
5457    }
5458    #[derive(Clone, Debug)]
5459    pub enum RetryDiscardReason<'a> {
5460        #[doc = " Received a Retry packet with SCID field equal to DCID field."]
5461        ScidEqualsDcid { cid: &'a [u8] },
5462        #[doc = " A client only processes at most one Retry packet."]
5463        RetryAlreadyProcessed,
5464        #[doc = " The client discards Retry packets if a valid Initial packet"]
5465        #[doc = " has been received and processed."]
5466        InitialAlreadyProcessed,
5467        #[doc = " The Retry packet received contained an invalid retry integrity tag"]
5468        InvalidIntegrityTag,
5469    }
5470    impl<'a> IntoEvent<api::RetryDiscardReason<'a>> for RetryDiscardReason<'a> {
5471        #[inline]
5472        fn into_event(self) -> api::RetryDiscardReason<'a> {
5473            use api::RetryDiscardReason::*;
5474            match self {
5475                Self::ScidEqualsDcid { cid } => ScidEqualsDcid {
5476                    cid: cid.into_event(),
5477                },
5478                Self::RetryAlreadyProcessed => RetryAlreadyProcessed {},
5479                Self::InitialAlreadyProcessed => InitialAlreadyProcessed {},
5480                Self::InvalidIntegrityTag => InvalidIntegrityTag {},
5481            }
5482        }
5483    }
5484    #[derive(Clone, Debug)]
5485    pub enum MigrationDenyReason {
5486        BlockedPort,
5487        PortScopeChanged,
5488        IpScopeChange,
5489        ConnectionMigrationDisabled,
5490    }
5491    impl IntoEvent<api::MigrationDenyReason> for MigrationDenyReason {
5492        #[inline]
5493        fn into_event(self) -> api::MigrationDenyReason {
5494            use api::MigrationDenyReason::*;
5495            match self {
5496                Self::BlockedPort => BlockedPort {},
5497                Self::PortScopeChanged => PortScopeChanged {},
5498                Self::IpScopeChange => IpScopeChange {},
5499                Self::ConnectionMigrationDisabled => ConnectionMigrationDisabled {},
5500            }
5501        }
5502    }
5503    #[derive(Clone, Debug)]
5504    #[doc = " The current state of the ECN controller for the path"]
5505    pub enum EcnState {
5506        #[doc = " ECN capability is being actively tested"]
5507        Testing,
5508        #[doc = " ECN capability has been tested, but not validated yet"]
5509        Unknown,
5510        #[doc = " ECN capability testing has failed validation"]
5511        Failed,
5512        #[doc = " ECN capability has been confirmed"]
5513        Capable,
5514    }
5515    impl IntoEvent<api::EcnState> for EcnState {
5516        #[inline]
5517        fn into_event(self) -> api::EcnState {
5518            use api::EcnState::*;
5519            match self {
5520                Self::Testing => Testing {},
5521                Self::Unknown => Unknown {},
5522                Self::Failed => Failed {},
5523                Self::Capable => Capable {},
5524            }
5525        }
5526    }
5527    #[derive(Clone, Debug)]
5528    #[doc = " Events tracking the progress of handshake status"]
5529    pub enum HandshakeStatus {
5530        #[doc = " The handshake has completed."]
5531        Complete,
5532        #[doc = " The handshake has been confirmed."]
5533        Confirmed,
5534        #[doc = " A HANDSHAKE_DONE frame was delivered or received."]
5535        #[doc = ""]
5536        #[doc = " A Client endpoint receives a HANDSHAKE_DONE frame and"]
5537        #[doc = " only a Server is allowed to send the HANDSHAKE_DONE"]
5538        #[doc = " frame."]
5539        HandshakeDoneAcked,
5540        #[doc = " A HANDSHAKE_DONE frame was declared lost."]
5541        #[doc = ""]
5542        #[doc = " The Server is responsible for re-transmitting the"]
5543        #[doc = " HANDSHAKE_DONE frame until it is acked by the peer."]
5544        HandshakeDoneLost,
5545    }
5546    impl IntoEvent<api::HandshakeStatus> for HandshakeStatus {
5547        #[inline]
5548        fn into_event(self) -> api::HandshakeStatus {
5549            use api::HandshakeStatus::*;
5550            match self {
5551                Self::Complete => Complete {},
5552                Self::Confirmed => Confirmed {},
5553                Self::HandshakeDoneAcked => HandshakeDoneAcked {},
5554                Self::HandshakeDoneLost => HandshakeDoneLost {},
5555            }
5556        }
5557    }
5558    #[derive(Clone, Debug)]
5559    #[doc = " The source that caused a congestion event"]
5560    pub enum CongestionSource {
5561        #[doc = " Explicit Congestion Notification"]
5562        Ecn,
5563        #[doc = " One or more packets were detected lost"]
5564        PacketLoss,
5565    }
5566    impl IntoEvent<api::CongestionSource> for CongestionSource {
5567        #[inline]
5568        fn into_event(self) -> api::CongestionSource {
5569            use api::CongestionSource::*;
5570            match self {
5571                Self::Ecn => Ecn {},
5572                Self::PacketLoss => PacketLoss {},
5573            }
5574        }
5575    }
5576    #[derive(Clone, Debug)]
5577    #[allow(non_camel_case_types)]
5578    pub enum CipherSuite {
5579        TLS_AES_128_GCM_SHA256,
5580        TLS_AES_256_GCM_SHA384,
5581        TLS_CHACHA20_POLY1305_SHA256,
5582        Unknown,
5583    }
5584    impl IntoEvent<api::CipherSuite> for CipherSuite {
5585        #[inline]
5586        fn into_event(self) -> api::CipherSuite {
5587            use api::CipherSuite::*;
5588            match self {
5589                Self::TLS_AES_128_GCM_SHA256 => TLS_AES_128_GCM_SHA256 {},
5590                Self::TLS_AES_256_GCM_SHA384 => TLS_AES_256_GCM_SHA384 {},
5591                Self::TLS_CHACHA20_POLY1305_SHA256 => TLS_CHACHA20_POLY1305_SHA256 {},
5592                Self::Unknown => Unknown {},
5593            }
5594        }
5595    }
5596    #[derive(Clone, Debug)]
5597    pub enum PathChallengeStatus {
5598        Validated,
5599        Abandoned,
5600    }
5601    impl IntoEvent<api::PathChallengeStatus> for PathChallengeStatus {
5602        #[inline]
5603        fn into_event(self) -> api::PathChallengeStatus {
5604            use api::PathChallengeStatus::*;
5605            match self {
5606                Self::Validated => Validated {},
5607                Self::Abandoned => Abandoned {},
5608            }
5609        }
5610    }
5611    #[derive(Clone, Debug)]
5612    #[doc = " The reason the slow start congestion controller state has been exited"]
5613    pub enum SlowStartExitCause {
5614        #[doc = " A packet was determined lost"]
5615        PacketLoss,
5616        #[doc = " An Explicit Congestion Notification: Congestion Experienced marking was received"]
5617        Ecn,
5618        #[doc = " The round trip time estimate was updated"]
5619        Rtt,
5620        #[doc = " Slow Start exited due to a reason other than those above"]
5621        #[doc = ""]
5622        #[doc = " With the Cubic congestion controller, this reason is used after the initial exiting of"]
5623        #[doc = " Slow Start, when the previously determined Slow Start threshold is exceed by the"]
5624        #[doc = " congestion window."]
5625        Other,
5626    }
5627    impl IntoEvent<api::SlowStartExitCause> for SlowStartExitCause {
5628        #[inline]
5629        fn into_event(self) -> api::SlowStartExitCause {
5630            use api::SlowStartExitCause::*;
5631            match self {
5632                Self::PacketLoss => PacketLoss {},
5633                Self::Ecn => Ecn {},
5634                Self::Rtt => Rtt {},
5635                Self::Other => Other {},
5636            }
5637        }
5638    }
5639    #[derive(Clone, Debug)]
5640    #[doc = " The reason the MTU was updated"]
5641    pub enum MtuUpdatedCause {
5642        #[doc = " The MTU was initialized with the default value"]
5643        NewPath,
5644        #[doc = " An MTU probe was acknowledged by the peer"]
5645        ProbeAcknowledged,
5646        #[doc = " A blackhole was detected"]
5647        Blackhole,
5648        #[doc = " An early packet using the configured InitialMtu was lost"]
5649        InitialMtuPacketLost,
5650        #[doc = " An early packet using the configured InitialMtu was acknowledged by the peer"]
5651        InitialMtuPacketAcknowledged,
5652        #[doc = " MTU probes larger than the current MTU were not acknowledged"]
5653        LargerProbesLost,
5654    }
5655    impl IntoEvent<api::MtuUpdatedCause> for MtuUpdatedCause {
5656        #[inline]
5657        fn into_event(self) -> api::MtuUpdatedCause {
5658            use api::MtuUpdatedCause::*;
5659            match self {
5660                Self::NewPath => NewPath {},
5661                Self::ProbeAcknowledged => ProbeAcknowledged {},
5662                Self::Blackhole => Blackhole {},
5663                Self::InitialMtuPacketLost => InitialMtuPacketLost {},
5664                Self::InitialMtuPacketAcknowledged => InitialMtuPacketAcknowledged {},
5665                Self::LargerProbesLost => LargerProbesLost {},
5666            }
5667        }
5668    }
5669    #[derive(Clone, Debug)]
5670    pub enum BbrState {
5671        Startup,
5672        Drain,
5673        ProbeBwDown,
5674        ProbeBwCruise,
5675        ProbeBwRefill,
5676        ProbeBwUp,
5677        ProbeRtt,
5678    }
5679    impl IntoEvent<api::BbrState> for BbrState {
5680        #[inline]
5681        fn into_event(self) -> api::BbrState {
5682            use api::BbrState::*;
5683            match self {
5684                Self::Startup => Startup {},
5685                Self::Drain => Drain {},
5686                Self::ProbeBwDown => ProbeBwDown {},
5687                Self::ProbeBwCruise => ProbeBwCruise {},
5688                Self::ProbeBwRefill => ProbeBwRefill {},
5689                Self::ProbeBwUp => ProbeBwUp {},
5690                Self::ProbeRtt => ProbeRtt {},
5691            }
5692        }
5693    }
5694    #[derive(Clone, Debug)]
5695    pub enum DcState {
5696        VersionNegotiated { version: u32 },
5697        NoVersionNegotiated,
5698        PathSecretsReady,
5699        Complete,
5700    }
5701    impl IntoEvent<api::DcState> for DcState {
5702        #[inline]
5703        fn into_event(self) -> api::DcState {
5704            use api::DcState::*;
5705            match self {
5706                Self::VersionNegotiated { version } => VersionNegotiated {
5707                    version: version.into_event(),
5708                },
5709                Self::NoVersionNegotiated => NoVersionNegotiated {},
5710                Self::PathSecretsReady => PathSecretsReady {},
5711                Self::Complete => Complete {},
5712            }
5713        }
5714    }
5715    #[derive(Clone, Debug)]
5716    #[doc = " Application level protocol"]
5717    pub struct ApplicationProtocolInformation<'a> {
5718        pub chosen_application_protocol: &'a [u8],
5719    }
5720    impl<'a> IntoEvent<api::ApplicationProtocolInformation<'a>> for ApplicationProtocolInformation<'a> {
5721        #[inline]
5722        fn into_event(self) -> api::ApplicationProtocolInformation<'a> {
5723            let ApplicationProtocolInformation {
5724                chosen_application_protocol,
5725            } = self;
5726            api::ApplicationProtocolInformation {
5727                chosen_application_protocol: chosen_application_protocol.into_event(),
5728            }
5729        }
5730    }
5731    #[derive(Clone, Debug)]
5732    #[doc = " Server Name was negotiated for the connection"]
5733    pub struct ServerNameInformation<'a> {
5734        pub chosen_server_name: &'a str,
5735    }
5736    impl<'a> IntoEvent<api::ServerNameInformation<'a>> for ServerNameInformation<'a> {
5737        #[inline]
5738        fn into_event(self) -> api::ServerNameInformation<'a> {
5739            let ServerNameInformation { chosen_server_name } = self;
5740            api::ServerNameInformation {
5741                chosen_server_name: chosen_server_name.into_event(),
5742            }
5743        }
5744    }
5745    #[derive(Clone, Debug)]
5746    #[doc = " Key Exchange Group was negotiated for the connection"]
5747    #[doc = ""]
5748    #[doc = " `contains_kem` is `true` if the `chosen_group_name`"]
5749    #[doc = " contains a key encapsulation mechanism"]
5750    pub struct KeyExchangeGroup<'a> {
5751        pub chosen_group_name: &'a str,
5752        pub contains_kem: bool,
5753    }
5754    impl<'a> IntoEvent<api::KeyExchangeGroup<'a>> for KeyExchangeGroup<'a> {
5755        #[inline]
5756        fn into_event(self) -> api::KeyExchangeGroup<'a> {
5757            let KeyExchangeGroup {
5758                chosen_group_name,
5759                contains_kem,
5760            } = self;
5761            api::KeyExchangeGroup {
5762                chosen_group_name: chosen_group_name.into_event(),
5763                contains_kem: contains_kem.into_event(),
5764            }
5765        }
5766    }
5767    #[derive(Clone, Debug)]
5768    #[doc = " Packet was skipped with a given reason"]
5769    pub struct PacketSkipped {
5770        pub number: u64,
5771        pub space: KeySpace,
5772        pub reason: PacketSkipReason,
5773    }
5774    impl IntoEvent<api::PacketSkipped> for PacketSkipped {
5775        #[inline]
5776        fn into_event(self) -> api::PacketSkipped {
5777            let PacketSkipped {
5778                number,
5779                space,
5780                reason,
5781            } = self;
5782            api::PacketSkipped {
5783                number: number.into_event(),
5784                space: space.into_event(),
5785                reason: reason.into_event(),
5786            }
5787        }
5788    }
5789    #[derive(Clone, Debug)]
5790    #[doc = " Packet was sent by a connection"]
5791    pub struct PacketSent {
5792        pub packet_header: PacketHeader,
5793        pub packet_len: usize,
5794    }
5795    impl IntoEvent<api::PacketSent> for PacketSent {
5796        #[inline]
5797        fn into_event(self) -> api::PacketSent {
5798            let PacketSent {
5799                packet_header,
5800                packet_len,
5801            } = self;
5802            api::PacketSent {
5803                packet_header: packet_header.into_event(),
5804                packet_len: packet_len.into_event(),
5805            }
5806        }
5807    }
5808    #[derive(Clone, Debug)]
5809    #[doc = " Packet was received by a connection"]
5810    pub struct PacketReceived {
5811        pub packet_header: PacketHeader,
5812    }
5813    impl IntoEvent<api::PacketReceived> for PacketReceived {
5814        #[inline]
5815        fn into_event(self) -> api::PacketReceived {
5816            let PacketReceived { packet_header } = self;
5817            api::PacketReceived {
5818                packet_header: packet_header.into_event(),
5819            }
5820        }
5821    }
5822    #[derive(Clone, Debug)]
5823    #[doc = " Active path was updated"]
5824    pub struct ActivePathUpdated<'a> {
5825        pub previous: Path<'a>,
5826        pub active: Path<'a>,
5827    }
5828    impl<'a> IntoEvent<api::ActivePathUpdated<'a>> for ActivePathUpdated<'a> {
5829        #[inline]
5830        fn into_event(self) -> api::ActivePathUpdated<'a> {
5831            let ActivePathUpdated { previous, active } = self;
5832            api::ActivePathUpdated {
5833                previous: previous.into_event(),
5834                active: active.into_event(),
5835            }
5836        }
5837    }
5838    #[derive(Clone, Debug)]
5839    #[doc = " A new path was created"]
5840    pub struct PathCreated<'a> {
5841        pub active: Path<'a>,
5842        pub new: Path<'a>,
5843    }
5844    impl<'a> IntoEvent<api::PathCreated<'a>> for PathCreated<'a> {
5845        #[inline]
5846        fn into_event(self) -> api::PathCreated<'a> {
5847            let PathCreated { active, new } = self;
5848            api::PathCreated {
5849                active: active.into_event(),
5850                new: new.into_event(),
5851            }
5852        }
5853    }
5854    #[derive(Clone, Debug)]
5855    #[doc = " Frame was sent"]
5856    pub struct FrameSent {
5857        pub packet_header: PacketHeader,
5858        pub path_id: u64,
5859        pub frame: Frame,
5860    }
5861    impl IntoEvent<api::FrameSent> for FrameSent {
5862        #[inline]
5863        fn into_event(self) -> api::FrameSent {
5864            let FrameSent {
5865                packet_header,
5866                path_id,
5867                frame,
5868            } = self;
5869            api::FrameSent {
5870                packet_header: packet_header.into_event(),
5871                path_id: path_id.into_event(),
5872                frame: frame.into_event(),
5873            }
5874        }
5875    }
5876    #[derive(Clone, Debug)]
5877    #[doc = " Frame was received"]
5878    pub struct FrameReceived<'a> {
5879        pub packet_header: PacketHeader,
5880        pub path: Path<'a>,
5881        pub frame: Frame,
5882    }
5883    impl<'a> IntoEvent<api::FrameReceived<'a>> for FrameReceived<'a> {
5884        #[inline]
5885        fn into_event(self) -> api::FrameReceived<'a> {
5886            let FrameReceived {
5887                packet_header,
5888                path,
5889                frame,
5890            } = self;
5891            api::FrameReceived {
5892                packet_header: packet_header.into_event(),
5893                path: path.into_event(),
5894                frame: frame.into_event(),
5895            }
5896        }
5897    }
5898    #[derive(Clone, Debug)]
5899    #[doc = " A `CONNECTION_CLOSE` frame was received"]
5900    #[doc = ""]
5901    #[doc = " This event includes additional details from the frame, particularly the"]
5902    #[doc = " reason (if provided) the peer closed the connection"]
5903    pub struct ConnectionCloseFrameReceived<'a> {
5904        pub packet_header: PacketHeader,
5905        pub path: Path<'a>,
5906        pub frame: ConnectionCloseFrame<'a>,
5907    }
5908    impl<'a> IntoEvent<api::ConnectionCloseFrameReceived<'a>> for ConnectionCloseFrameReceived<'a> {
5909        #[inline]
5910        fn into_event(self) -> api::ConnectionCloseFrameReceived<'a> {
5911            let ConnectionCloseFrameReceived {
5912                packet_header,
5913                path,
5914                frame,
5915            } = self;
5916            api::ConnectionCloseFrameReceived {
5917                packet_header: packet_header.into_event(),
5918                path: path.into_event(),
5919                frame: frame.into_event(),
5920            }
5921        }
5922    }
5923    #[derive(Clone, Debug)]
5924    #[doc = " Packet was lost"]
5925    pub struct PacketLost<'a> {
5926        pub packet_header: PacketHeader,
5927        pub path: Path<'a>,
5928        pub bytes_lost: u16,
5929        pub is_mtu_probe: bool,
5930    }
5931    impl<'a> IntoEvent<api::PacketLost<'a>> for PacketLost<'a> {
5932        #[inline]
5933        fn into_event(self) -> api::PacketLost<'a> {
5934            let PacketLost {
5935                packet_header,
5936                path,
5937                bytes_lost,
5938                is_mtu_probe,
5939            } = self;
5940            api::PacketLost {
5941                packet_header: packet_header.into_event(),
5942                path: path.into_event(),
5943                bytes_lost: bytes_lost.into_event(),
5944                is_mtu_probe: is_mtu_probe.into_event(),
5945            }
5946        }
5947    }
5948    #[derive(Clone, Debug)]
5949    #[doc = " Recovery metrics updated"]
5950    pub struct RecoveryMetrics<'a> {
5951        pub path: Path<'a>,
5952        pub min_rtt: Duration,
5953        pub smoothed_rtt: Duration,
5954        pub latest_rtt: Duration,
5955        pub rtt_variance: Duration,
5956        pub max_ack_delay: Duration,
5957        pub pto_count: u32,
5958        pub congestion_window: u32,
5959        pub bytes_in_flight: u32,
5960        pub congestion_limited: bool,
5961    }
5962    impl<'a> IntoEvent<api::RecoveryMetrics<'a>> for RecoveryMetrics<'a> {
5963        #[inline]
5964        fn into_event(self) -> api::RecoveryMetrics<'a> {
5965            let RecoveryMetrics {
5966                path,
5967                min_rtt,
5968                smoothed_rtt,
5969                latest_rtt,
5970                rtt_variance,
5971                max_ack_delay,
5972                pto_count,
5973                congestion_window,
5974                bytes_in_flight,
5975                congestion_limited,
5976            } = self;
5977            api::RecoveryMetrics {
5978                path: path.into_event(),
5979                min_rtt: min_rtt.into_event(),
5980                smoothed_rtt: smoothed_rtt.into_event(),
5981                latest_rtt: latest_rtt.into_event(),
5982                rtt_variance: rtt_variance.into_event(),
5983                max_ack_delay: max_ack_delay.into_event(),
5984                pto_count: pto_count.into_event(),
5985                congestion_window: congestion_window.into_event(),
5986                bytes_in_flight: bytes_in_flight.into_event(),
5987                congestion_limited: congestion_limited.into_event(),
5988            }
5989        }
5990    }
5991    #[derive(Clone, Debug)]
5992    #[doc = " Congestion (ECN or packet loss) has occurred"]
5993    pub struct Congestion<'a> {
5994        pub path: Path<'a>,
5995        pub source: CongestionSource,
5996    }
5997    impl<'a> IntoEvent<api::Congestion<'a>> for Congestion<'a> {
5998        #[inline]
5999        fn into_event(self) -> api::Congestion<'a> {
6000            let Congestion { path, source } = self;
6001            api::Congestion {
6002                path: path.into_event(),
6003                source: source.into_event(),
6004            }
6005        }
6006    }
6007    #[derive(Clone, Debug)]
6008    #[doc = " Events related to ACK processing"]
6009    pub struct AckProcessed<'a> {
6010        pub action: AckAction,
6011        pub path: Path<'a>,
6012    }
6013    #[allow(deprecated)]
6014    impl<'a> IntoEvent<api::AckProcessed<'a>> for AckProcessed<'a> {
6015        #[inline]
6016        fn into_event(self) -> api::AckProcessed<'a> {
6017            let AckProcessed { action, path } = self;
6018            api::AckProcessed {
6019                action: action.into_event(),
6020                path: path.into_event(),
6021            }
6022        }
6023    }
6024    #[derive(Clone, Debug)]
6025    #[doc = " Ack range for received packets was dropped due to space constraints"]
6026    #[doc = ""]
6027    #[doc = " For the purpose of processing Acks, RX packet numbers are stored as"]
6028    #[doc = " packet_number ranges in an IntervalSet; only lower and upper bounds"]
6029    #[doc = " are stored instead of individual packet_numbers. Ranges are merged"]
6030    #[doc = " when possible so only disjointed ranges are stored."]
6031    #[doc = ""]
6032    #[doc = " When at `capacity`, the lowest packet_number range is dropped."]
6033    pub struct RxAckRangeDropped<'a> {
6034        pub path: Path<'a>,
6035        #[doc = " The packet number range which was dropped"]
6036        pub packet_number_range: core::ops::RangeInclusive<u64>,
6037        #[doc = " The number of disjoint ranges the IntervalSet can store"]
6038        pub capacity: usize,
6039        #[doc = " The store packet_number range in the IntervalSet"]
6040        pub stored_range: core::ops::RangeInclusive<u64>,
6041    }
6042    impl<'a> IntoEvent<api::RxAckRangeDropped<'a>> for RxAckRangeDropped<'a> {
6043        #[inline]
6044        fn into_event(self) -> api::RxAckRangeDropped<'a> {
6045            let RxAckRangeDropped {
6046                path,
6047                packet_number_range,
6048                capacity,
6049                stored_range,
6050            } = self;
6051            api::RxAckRangeDropped {
6052                path: path.into_event(),
6053                packet_number_range: packet_number_range.into_event(),
6054                capacity: capacity.into_event(),
6055                stored_range: stored_range.into_event(),
6056            }
6057        }
6058    }
6059    #[derive(Clone, Debug)]
6060    #[doc = " ACK range was received"]
6061    pub struct AckRangeReceived<'a> {
6062        pub packet_header: PacketHeader,
6063        pub path: Path<'a>,
6064        pub ack_range: RangeInclusive<u64>,
6065    }
6066    impl<'a> IntoEvent<api::AckRangeReceived<'a>> for AckRangeReceived<'a> {
6067        #[inline]
6068        fn into_event(self) -> api::AckRangeReceived<'a> {
6069            let AckRangeReceived {
6070                packet_header,
6071                path,
6072                ack_range,
6073            } = self;
6074            api::AckRangeReceived {
6075                packet_header: packet_header.into_event(),
6076                path: path.into_event(),
6077                ack_range: ack_range.into_event(),
6078            }
6079        }
6080    }
6081    #[derive(Clone, Debug)]
6082    #[doc = " ACK range was sent"]
6083    pub struct AckRangeSent {
6084        pub packet_header: PacketHeader,
6085        pub path_id: u64,
6086        pub ack_range: RangeInclusive<u64>,
6087    }
6088    impl IntoEvent<api::AckRangeSent> for AckRangeSent {
6089        #[inline]
6090        fn into_event(self) -> api::AckRangeSent {
6091            let AckRangeSent {
6092                packet_header,
6093                path_id,
6094                ack_range,
6095            } = self;
6096            api::AckRangeSent {
6097                packet_header: packet_header.into_event(),
6098                path_id: path_id.into_event(),
6099                ack_range: ack_range.into_event(),
6100            }
6101        }
6102    }
6103    #[derive(Clone, Debug)]
6104    #[doc = " Packet was dropped with the given reason"]
6105    pub struct PacketDropped<'a> {
6106        pub reason: PacketDropReason<'a>,
6107    }
6108    impl<'a> IntoEvent<api::PacketDropped<'a>> for PacketDropped<'a> {
6109        #[inline]
6110        fn into_event(self) -> api::PacketDropped<'a> {
6111            let PacketDropped { reason } = self;
6112            api::PacketDropped {
6113                reason: reason.into_event(),
6114            }
6115        }
6116    }
6117    #[derive(Clone, Debug)]
6118    #[doc = " Crypto key updated"]
6119    pub struct KeyUpdate {
6120        pub key_type: KeyType,
6121        pub cipher_suite: CipherSuite,
6122    }
6123    impl IntoEvent<api::KeyUpdate> for KeyUpdate {
6124        #[inline]
6125        fn into_event(self) -> api::KeyUpdate {
6126            let KeyUpdate {
6127                key_type,
6128                cipher_suite,
6129            } = self;
6130            api::KeyUpdate {
6131                key_type: key_type.into_event(),
6132                cipher_suite: cipher_suite.into_event(),
6133            }
6134        }
6135    }
6136    #[derive(Clone, Debug)]
6137    pub struct KeySpaceDiscarded {
6138        pub space: KeySpace,
6139    }
6140    impl IntoEvent<api::KeySpaceDiscarded> for KeySpaceDiscarded {
6141        #[inline]
6142        fn into_event(self) -> api::KeySpaceDiscarded {
6143            let KeySpaceDiscarded { space } = self;
6144            api::KeySpaceDiscarded {
6145                space: space.into_event(),
6146            }
6147        }
6148    }
6149    #[derive(Clone, Debug)]
6150    #[doc = " Connection started"]
6151    pub struct ConnectionStarted<'a> {
6152        pub path: Path<'a>,
6153    }
6154    impl<'a> IntoEvent<api::ConnectionStarted<'a>> for ConnectionStarted<'a> {
6155        #[inline]
6156        fn into_event(self) -> api::ConnectionStarted<'a> {
6157            let ConnectionStarted { path } = self;
6158            api::ConnectionStarted {
6159                path: path.into_event(),
6160            }
6161        }
6162    }
6163    #[derive(Clone, Debug)]
6164    #[doc = " Duplicate packet received"]
6165    pub struct DuplicatePacket<'a> {
6166        pub packet_header: PacketHeader,
6167        pub path: Path<'a>,
6168        pub error: DuplicatePacketError,
6169    }
6170    impl<'a> IntoEvent<api::DuplicatePacket<'a>> for DuplicatePacket<'a> {
6171        #[inline]
6172        fn into_event(self) -> api::DuplicatePacket<'a> {
6173            let DuplicatePacket {
6174                packet_header,
6175                path,
6176                error,
6177            } = self;
6178            api::DuplicatePacket {
6179                packet_header: packet_header.into_event(),
6180                path: path.into_event(),
6181                error: error.into_event(),
6182            }
6183        }
6184    }
6185    #[derive(Clone, Debug)]
6186    #[doc = " Transport parameters received by connection"]
6187    pub struct TransportParametersReceived<'a> {
6188        pub transport_parameters: TransportParameters<'a>,
6189    }
6190    impl<'a> IntoEvent<api::TransportParametersReceived<'a>> for TransportParametersReceived<'a> {
6191        #[inline]
6192        fn into_event(self) -> api::TransportParametersReceived<'a> {
6193            let TransportParametersReceived {
6194                transport_parameters,
6195            } = self;
6196            api::TransportParametersReceived {
6197                transport_parameters: transport_parameters.into_event(),
6198            }
6199        }
6200    }
6201    #[derive(Clone, Debug)]
6202    #[doc = " Datagram sent by a connection"]
6203    pub struct DatagramSent {
6204        pub len: u16,
6205        #[doc = " The GSO offset at which this datagram was written"]
6206        #[doc = ""]
6207        #[doc = " If this value is greater than 0, it indicates that this datagram has been sent with other"]
6208        #[doc = " segments in a single buffer."]
6209        #[doc = ""]
6210        #[doc = " See the [Linux kernel documentation](https://www.kernel.org/doc/html/latest/networking/segmentation-offloads.html#generic-segmentation-offload) for more details."]
6211        pub gso_offset: usize,
6212    }
6213    impl IntoEvent<api::DatagramSent> for DatagramSent {
6214        #[inline]
6215        fn into_event(self) -> api::DatagramSent {
6216            let DatagramSent { len, gso_offset } = self;
6217            api::DatagramSent {
6218                len: len.into_event(),
6219                gso_offset: gso_offset.into_event(),
6220            }
6221        }
6222    }
6223    #[derive(Clone, Debug)]
6224    #[doc = " Datagram received by a connection"]
6225    pub struct DatagramReceived {
6226        pub len: u16,
6227    }
6228    impl IntoEvent<api::DatagramReceived> for DatagramReceived {
6229        #[inline]
6230        fn into_event(self) -> api::DatagramReceived {
6231            let DatagramReceived { len } = self;
6232            api::DatagramReceived {
6233                len: len.into_event(),
6234            }
6235        }
6236    }
6237    #[derive(Clone, Debug)]
6238    #[doc = " Datagram dropped by a connection"]
6239    pub struct DatagramDropped<'a> {
6240        pub local_addr: SocketAddress<'a>,
6241        pub remote_addr: SocketAddress<'a>,
6242        pub destination_cid: ConnectionId<'a>,
6243        pub source_cid: Option<ConnectionId<'a>>,
6244        pub len: u16,
6245        pub reason: DatagramDropReason,
6246    }
6247    impl<'a> IntoEvent<api::DatagramDropped<'a>> for DatagramDropped<'a> {
6248        #[inline]
6249        fn into_event(self) -> api::DatagramDropped<'a> {
6250            let DatagramDropped {
6251                local_addr,
6252                remote_addr,
6253                destination_cid,
6254                source_cid,
6255                len,
6256                reason,
6257            } = self;
6258            api::DatagramDropped {
6259                local_addr: local_addr.into_event(),
6260                remote_addr: remote_addr.into_event(),
6261                destination_cid: destination_cid.into_event(),
6262                source_cid: source_cid.into_event(),
6263                len: len.into_event(),
6264                reason: reason.into_event(),
6265            }
6266        }
6267    }
6268    #[derive(Clone, Debug)]
6269    #[doc = " The remote address was changed before the handshake was complete"]
6270    pub struct HandshakeRemoteAddressChangeObserved<'a> {
6271        pub local_addr: SocketAddress<'a>,
6272        #[doc = " The newly observed remote address"]
6273        pub remote_addr: SocketAddress<'a>,
6274        #[doc = " The remote address established from the initial packet"]
6275        pub initial_remote_addr: SocketAddress<'a>,
6276    }
6277    impl<'a> IntoEvent<api::HandshakeRemoteAddressChangeObserved<'a>>
6278        for HandshakeRemoteAddressChangeObserved<'a>
6279    {
6280        #[inline]
6281        fn into_event(self) -> api::HandshakeRemoteAddressChangeObserved<'a> {
6282            let HandshakeRemoteAddressChangeObserved {
6283                local_addr,
6284                remote_addr,
6285                initial_remote_addr,
6286            } = self;
6287            api::HandshakeRemoteAddressChangeObserved {
6288                local_addr: local_addr.into_event(),
6289                remote_addr: remote_addr.into_event(),
6290                initial_remote_addr: initial_remote_addr.into_event(),
6291            }
6292        }
6293    }
6294    #[derive(Clone, Debug)]
6295    #[doc = " ConnectionId updated"]
6296    pub struct ConnectionIdUpdated<'a> {
6297        pub path_id: u64,
6298        #[doc = " The endpoint that updated its connection id"]
6299        pub cid_consumer: crate::endpoint::Location,
6300        pub previous: ConnectionId<'a>,
6301        pub current: ConnectionId<'a>,
6302    }
6303    impl<'a> IntoEvent<api::ConnectionIdUpdated<'a>> for ConnectionIdUpdated<'a> {
6304        #[inline]
6305        fn into_event(self) -> api::ConnectionIdUpdated<'a> {
6306            let ConnectionIdUpdated {
6307                path_id,
6308                cid_consumer,
6309                previous,
6310                current,
6311            } = self;
6312            api::ConnectionIdUpdated {
6313                path_id: path_id.into_event(),
6314                cid_consumer: cid_consumer.into_event(),
6315                previous: previous.into_event(),
6316                current: current.into_event(),
6317            }
6318        }
6319    }
6320    #[derive(Clone, Debug)]
6321    pub struct EcnStateChanged<'a> {
6322        pub path: Path<'a>,
6323        pub state: EcnState,
6324    }
6325    impl<'a> IntoEvent<api::EcnStateChanged<'a>> for EcnStateChanged<'a> {
6326        #[inline]
6327        fn into_event(self) -> api::EcnStateChanged<'a> {
6328            let EcnStateChanged { path, state } = self;
6329            api::EcnStateChanged {
6330                path: path.into_event(),
6331                state: state.into_event(),
6332            }
6333        }
6334    }
6335    #[derive(Clone, Debug)]
6336    pub struct ConnectionMigrationDenied {
6337        pub reason: MigrationDenyReason,
6338    }
6339    impl IntoEvent<api::ConnectionMigrationDenied> for ConnectionMigrationDenied {
6340        #[inline]
6341        fn into_event(self) -> api::ConnectionMigrationDenied {
6342            let ConnectionMigrationDenied { reason } = self;
6343            api::ConnectionMigrationDenied {
6344                reason: reason.into_event(),
6345            }
6346        }
6347    }
6348    #[derive(Clone, Debug)]
6349    pub struct HandshakeStatusUpdated {
6350        pub status: HandshakeStatus,
6351    }
6352    impl IntoEvent<api::HandshakeStatusUpdated> for HandshakeStatusUpdated {
6353        #[inline]
6354        fn into_event(self) -> api::HandshakeStatusUpdated {
6355            let HandshakeStatusUpdated { status } = self;
6356            api::HandshakeStatusUpdated {
6357                status: status.into_event(),
6358            }
6359        }
6360    }
6361    #[derive(Clone, Debug)]
6362    pub struct TlsExporterReady<'a> {
6363        pub session: crate::event::TlsSession<'a>,
6364    }
6365    impl<'a> IntoEvent<api::TlsExporterReady<'a>> for TlsExporterReady<'a> {
6366        #[inline]
6367        fn into_event(self) -> api::TlsExporterReady<'a> {
6368            let TlsExporterReady { session } = self;
6369            api::TlsExporterReady {
6370                session: session.into_event(),
6371            }
6372        }
6373    }
6374    #[derive(Clone, Debug)]
6375    pub struct TlsHandshakeFailed<'a> {
6376        pub session: crate::event::TlsSession<'a>,
6377        pub error: &'a (dyn core::error::Error + Send + Sync + 'static),
6378    }
6379    impl<'a> IntoEvent<api::TlsHandshakeFailed<'a>> for TlsHandshakeFailed<'a> {
6380        #[inline]
6381        fn into_event(self) -> api::TlsHandshakeFailed<'a> {
6382            let TlsHandshakeFailed { session, error } = self;
6383            api::TlsHandshakeFailed {
6384                session: session.into_event(),
6385                error: error.into_event(),
6386            }
6387        }
6388    }
6389    #[derive(Clone, Debug)]
6390    #[doc = " Path challenge updated"]
6391    pub struct PathChallengeUpdated<'a> {
6392        pub path_challenge_status: PathChallengeStatus,
6393        pub path: Path<'a>,
6394        pub challenge_data: &'a [u8],
6395    }
6396    impl<'a> IntoEvent<api::PathChallengeUpdated<'a>> for PathChallengeUpdated<'a> {
6397        #[inline]
6398        fn into_event(self) -> api::PathChallengeUpdated<'a> {
6399            let PathChallengeUpdated {
6400                path_challenge_status,
6401                path,
6402                challenge_data,
6403            } = self;
6404            api::PathChallengeUpdated {
6405                path_challenge_status: path_challenge_status.into_event(),
6406                path: path.into_event(),
6407                challenge_data: challenge_data.into_event(),
6408            }
6409        }
6410    }
6411    #[derive(Clone, Debug)]
6412    pub struct TlsClientHello<'a> {
6413        pub payload: &'a [&'a [u8]],
6414    }
6415    impl<'a> IntoEvent<api::TlsClientHello<'a>> for TlsClientHello<'a> {
6416        #[inline]
6417        fn into_event(self) -> api::TlsClientHello<'a> {
6418            let TlsClientHello { payload } = self;
6419            api::TlsClientHello {
6420                payload: payload.into_event(),
6421            }
6422        }
6423    }
6424    #[derive(Clone, Debug)]
6425    pub struct TlsServerHello<'a> {
6426        pub payload: &'a [&'a [u8]],
6427    }
6428    impl<'a> IntoEvent<api::TlsServerHello<'a>> for TlsServerHello<'a> {
6429        #[inline]
6430        fn into_event(self) -> api::TlsServerHello<'a> {
6431            let TlsServerHello { payload } = self;
6432            api::TlsServerHello {
6433                payload: payload.into_event(),
6434            }
6435        }
6436    }
6437    #[derive(Clone, Debug)]
6438    pub struct RxStreamProgress {
6439        pub bytes: usize,
6440    }
6441    impl IntoEvent<api::RxStreamProgress> for RxStreamProgress {
6442        #[inline]
6443        fn into_event(self) -> api::RxStreamProgress {
6444            let RxStreamProgress { bytes } = self;
6445            api::RxStreamProgress {
6446                bytes: bytes.into_event(),
6447            }
6448        }
6449    }
6450    #[derive(Clone, Debug)]
6451    pub struct TxStreamProgress {
6452        pub bytes: usize,
6453    }
6454    impl IntoEvent<api::TxStreamProgress> for TxStreamProgress {
6455        #[inline]
6456        fn into_event(self) -> api::TxStreamProgress {
6457            let TxStreamProgress { bytes } = self;
6458            api::TxStreamProgress {
6459                bytes: bytes.into_event(),
6460            }
6461        }
6462    }
6463    #[derive(Clone, Debug)]
6464    pub struct KeepAliveTimerExpired {
6465        pub timeout: Duration,
6466    }
6467    impl IntoEvent<api::KeepAliveTimerExpired> for KeepAliveTimerExpired {
6468        #[inline]
6469        fn into_event(self) -> api::KeepAliveTimerExpired {
6470            let KeepAliveTimerExpired { timeout } = self;
6471            api::KeepAliveTimerExpired {
6472                timeout: timeout.into_event(),
6473            }
6474        }
6475    }
6476    #[derive(Clone, Debug)]
6477    #[doc = " The maximum transmission unit (MTU) and/or MTU probing status for the path has changed"]
6478    pub struct MtuUpdated {
6479        pub path_id: u64,
6480        #[doc = " The maximum QUIC datagram size, not including UDP and IP headers"]
6481        pub mtu: u16,
6482        pub cause: MtuUpdatedCause,
6483        #[doc = " The search for the maximum MTU has completed for now"]
6484        pub search_complete: bool,
6485    }
6486    impl IntoEvent<api::MtuUpdated> for MtuUpdated {
6487        #[inline]
6488        fn into_event(self) -> api::MtuUpdated {
6489            let MtuUpdated {
6490                path_id,
6491                mtu,
6492                cause,
6493                search_complete,
6494            } = self;
6495            api::MtuUpdated {
6496                path_id: path_id.into_event(),
6497                mtu: mtu.into_event(),
6498                cause: cause.into_event(),
6499                search_complete: search_complete.into_event(),
6500            }
6501        }
6502    }
6503    #[derive(Clone, Debug)]
6504    #[doc = " MTU_PROBING_COMPLETE frame was received"]
6505    pub struct MtuProbingCompleteReceived<'a> {
6506        pub packet_header: PacketHeader,
6507        pub path: Path<'a>,
6508        #[doc = " The confirmed MTU value from the frame"]
6509        pub mtu: u16,
6510    }
6511    impl<'a> IntoEvent<api::MtuProbingCompleteReceived<'a>> for MtuProbingCompleteReceived<'a> {
6512        #[inline]
6513        fn into_event(self) -> api::MtuProbingCompleteReceived<'a> {
6514            let MtuProbingCompleteReceived {
6515                packet_header,
6516                path,
6517                mtu,
6518            } = self;
6519            api::MtuProbingCompleteReceived {
6520                packet_header: packet_header.into_event(),
6521                path: path.into_event(),
6522                mtu: mtu.into_event(),
6523            }
6524        }
6525    }
6526    #[derive(Clone, Debug)]
6527    #[doc = " The slow start congestion controller state has been exited"]
6528    pub struct SlowStartExited {
6529        pub path_id: u64,
6530        pub cause: SlowStartExitCause,
6531        pub congestion_window: u32,
6532    }
6533    impl IntoEvent<api::SlowStartExited> for SlowStartExited {
6534        #[inline]
6535        fn into_event(self) -> api::SlowStartExited {
6536            let SlowStartExited {
6537                path_id,
6538                cause,
6539                congestion_window,
6540            } = self;
6541            api::SlowStartExited {
6542                path_id: path_id.into_event(),
6543                cause: cause.into_event(),
6544                congestion_window: congestion_window.into_event(),
6545            }
6546        }
6547    }
6548    #[derive(Clone, Debug)]
6549    #[doc = " A new delivery rate sample has been generated"]
6550    #[doc = " Note: This event is only recorded for congestion controllers that support"]
6551    #[doc = "       bandwidth estimates, such as BBR"]
6552    pub struct DeliveryRateSampled {
6553        pub path_id: u64,
6554        pub rate_sample: RateSample,
6555    }
6556    impl IntoEvent<api::DeliveryRateSampled> for DeliveryRateSampled {
6557        #[inline]
6558        fn into_event(self) -> api::DeliveryRateSampled {
6559            let DeliveryRateSampled {
6560                path_id,
6561                rate_sample,
6562            } = self;
6563            api::DeliveryRateSampled {
6564                path_id: path_id.into_event(),
6565                rate_sample: rate_sample.into_event(),
6566            }
6567        }
6568    }
6569    #[derive(Clone, Debug)]
6570    #[doc = " The pacing rate has been updated"]
6571    pub struct PacingRateUpdated {
6572        pub path_id: u64,
6573        pub bytes_per_second: u64,
6574        pub burst_size: u32,
6575        pub pacing_gain: f32,
6576    }
6577    impl IntoEvent<api::PacingRateUpdated> for PacingRateUpdated {
6578        #[inline]
6579        fn into_event(self) -> api::PacingRateUpdated {
6580            let PacingRateUpdated {
6581                path_id,
6582                bytes_per_second,
6583                burst_size,
6584                pacing_gain,
6585            } = self;
6586            api::PacingRateUpdated {
6587                path_id: path_id.into_event(),
6588                bytes_per_second: bytes_per_second.into_event(),
6589                burst_size: burst_size.into_event(),
6590                pacing_gain: pacing_gain.into_event(),
6591            }
6592        }
6593    }
6594    #[derive(Clone, Debug)]
6595    #[doc = " The BBR state has changed"]
6596    pub struct BbrStateChanged {
6597        pub path_id: u64,
6598        pub state: BbrState,
6599    }
6600    impl IntoEvent<api::BbrStateChanged> for BbrStateChanged {
6601        #[inline]
6602        fn into_event(self) -> api::BbrStateChanged {
6603            let BbrStateChanged { path_id, state } = self;
6604            api::BbrStateChanged {
6605                path_id: path_id.into_event(),
6606                state: state.into_event(),
6607            }
6608        }
6609    }
6610    #[derive(Clone, Debug)]
6611    #[doc = " The DC state has changed"]
6612    pub struct DcStateChanged {
6613        pub state: DcState,
6614    }
6615    impl IntoEvent<api::DcStateChanged> for DcStateChanged {
6616        #[inline]
6617        fn into_event(self) -> api::DcStateChanged {
6618            let DcStateChanged { state } = self;
6619            api::DcStateChanged {
6620                state: state.into_event(),
6621            }
6622        }
6623    }
6624    #[derive(Clone, Debug)]
6625    #[doc = " The DC path has been created"]
6626    pub struct DcPathCreated<'a> {
6627        #[doc = " This is the dc::Path struct, it's just type-erased. But if an event subscriber knows the"]
6628        #[doc = " type they can downcast."]
6629        pub path: &'a (dyn core::any::Any + Send + 'static),
6630    }
6631    impl<'a> IntoEvent<api::DcPathCreated<'a>> for DcPathCreated<'a> {
6632        #[inline]
6633        fn into_event(self) -> api::DcPathCreated<'a> {
6634            let DcPathCreated { path } = self;
6635            api::DcPathCreated {
6636                path: path.into_event(),
6637            }
6638        }
6639    }
6640    #[derive(Clone, Debug)]
6641    #[doc = " Connection closed"]
6642    pub struct ConnectionClosed {
6643        pub error: crate::connection::Error,
6644    }
6645    impl IntoEvent<api::ConnectionClosed> for ConnectionClosed {
6646        #[inline]
6647        fn into_event(self) -> api::ConnectionClosed {
6648            let ConnectionClosed { error } = self;
6649            api::ConnectionClosed {
6650                error: error.into_event(),
6651            }
6652        }
6653    }
6654    #[derive(Clone, Debug)]
6655    #[doc = " QUIC version"]
6656    pub struct VersionInformation<'a> {
6657        pub server_versions: &'a [u32],
6658        pub client_versions: &'a [u32],
6659        pub chosen_version: Option<u32>,
6660    }
6661    impl<'a> IntoEvent<api::VersionInformation<'a>> for VersionInformation<'a> {
6662        #[inline]
6663        fn into_event(self) -> api::VersionInformation<'a> {
6664            let VersionInformation {
6665                server_versions,
6666                client_versions,
6667                chosen_version,
6668            } = self;
6669            api::VersionInformation {
6670                server_versions: server_versions.into_event(),
6671                client_versions: client_versions.into_event(),
6672                chosen_version: chosen_version.into_event(),
6673            }
6674        }
6675    }
6676    #[derive(Clone, Debug)]
6677    #[doc = " Packet was sent by the endpoint"]
6678    pub struct EndpointPacketSent {
6679        pub packet_header: PacketHeader,
6680    }
6681    impl IntoEvent<api::EndpointPacketSent> for EndpointPacketSent {
6682        #[inline]
6683        fn into_event(self) -> api::EndpointPacketSent {
6684            let EndpointPacketSent { packet_header } = self;
6685            api::EndpointPacketSent {
6686                packet_header: packet_header.into_event(),
6687            }
6688        }
6689    }
6690    #[derive(Clone, Debug)]
6691    #[doc = " Packet was received by the endpoint"]
6692    pub struct EndpointPacketReceived {
6693        pub packet_header: PacketHeader,
6694    }
6695    impl IntoEvent<api::EndpointPacketReceived> for EndpointPacketReceived {
6696        #[inline]
6697        fn into_event(self) -> api::EndpointPacketReceived {
6698            let EndpointPacketReceived { packet_header } = self;
6699            api::EndpointPacketReceived {
6700                packet_header: packet_header.into_event(),
6701            }
6702        }
6703    }
6704    #[derive(Clone, Debug)]
6705    #[doc = " Datagram sent by the endpoint"]
6706    pub struct EndpointDatagramSent {
6707        pub len: u16,
6708        #[doc = " The GSO offset at which this datagram was written"]
6709        #[doc = ""]
6710        #[doc = " If this value is greater than 0, it indicates that this datagram has been sent with other"]
6711        #[doc = " segments in a single buffer."]
6712        #[doc = ""]
6713        #[doc = " See the [Linux kernel documentation](https://www.kernel.org/doc/html/latest/networking/segmentation-offloads.html#generic-segmentation-offload) for more details."]
6714        pub gso_offset: usize,
6715    }
6716    impl IntoEvent<api::EndpointDatagramSent> for EndpointDatagramSent {
6717        #[inline]
6718        fn into_event(self) -> api::EndpointDatagramSent {
6719            let EndpointDatagramSent { len, gso_offset } = self;
6720            api::EndpointDatagramSent {
6721                len: len.into_event(),
6722                gso_offset: gso_offset.into_event(),
6723            }
6724        }
6725    }
6726    #[derive(Clone, Debug)]
6727    #[doc = " Datagram received by the endpoint"]
6728    pub struct EndpointDatagramReceived {
6729        pub len: u16,
6730    }
6731    impl IntoEvent<api::EndpointDatagramReceived> for EndpointDatagramReceived {
6732        #[inline]
6733        fn into_event(self) -> api::EndpointDatagramReceived {
6734            let EndpointDatagramReceived { len } = self;
6735            api::EndpointDatagramReceived {
6736                len: len.into_event(),
6737            }
6738        }
6739    }
6740    #[derive(Clone, Debug)]
6741    #[doc = " Datagram dropped by the endpoint"]
6742    pub struct EndpointDatagramDropped {
6743        pub len: u16,
6744        pub reason: DatagramDropReason,
6745    }
6746    impl IntoEvent<api::EndpointDatagramDropped> for EndpointDatagramDropped {
6747        #[inline]
6748        fn into_event(self) -> api::EndpointDatagramDropped {
6749            let EndpointDatagramDropped { len, reason } = self;
6750            api::EndpointDatagramDropped {
6751                len: len.into_event(),
6752                reason: reason.into_event(),
6753            }
6754        }
6755    }
6756    #[derive(Clone, Debug)]
6757    pub struct EndpointConnectionAttemptFailed {
6758        pub error: crate::connection::Error,
6759    }
6760    impl IntoEvent<api::EndpointConnectionAttemptFailed> for EndpointConnectionAttemptFailed {
6761        #[inline]
6762        fn into_event(self) -> api::EndpointConnectionAttemptFailed {
6763            let EndpointConnectionAttemptFailed { error } = self;
6764            api::EndpointConnectionAttemptFailed {
6765                error: error.into_event(),
6766            }
6767        }
6768    }
6769    #[derive(Clone, Debug)]
6770    pub struct EndpointConnectionAttemptDeduplicated {
6771        #[doc = " The internal connection ID this deduplicated with."]
6772        pub connection_id: u64,
6773        pub already_open: bool,
6774    }
6775    impl IntoEvent<api::EndpointConnectionAttemptDeduplicated>
6776        for EndpointConnectionAttemptDeduplicated
6777    {
6778        #[inline]
6779        fn into_event(self) -> api::EndpointConnectionAttemptDeduplicated {
6780            let EndpointConnectionAttemptDeduplicated {
6781                connection_id,
6782                already_open,
6783            } = self;
6784            api::EndpointConnectionAttemptDeduplicated {
6785                connection_id: connection_id.into_event(),
6786                already_open: already_open.into_event(),
6787            }
6788        }
6789    }
6790    #[derive(Clone, Debug)]
6791    #[doc = " Emitted when the platform sends at least one packet"]
6792    pub struct PlatformTx {
6793        #[doc = " The number of packets sent"]
6794        pub count: usize,
6795        #[doc = " The number of syscalls performed"]
6796        pub syscalls: usize,
6797        #[doc = " The number of syscalls that got blocked"]
6798        pub blocked_syscalls: usize,
6799        #[doc = " The total number of errors encountered since the last event"]
6800        pub total_errors: usize,
6801        #[doc = " The number of specific error codes dropped"]
6802        #[doc = ""]
6803        #[doc = " This can happen when a burst of errors exceeds the capacity of the recorder"]
6804        pub dropped_errors: usize,
6805    }
6806    impl IntoEvent<api::PlatformTx> for PlatformTx {
6807        #[inline]
6808        fn into_event(self) -> api::PlatformTx {
6809            let PlatformTx {
6810                count,
6811                syscalls,
6812                blocked_syscalls,
6813                total_errors,
6814                dropped_errors,
6815            } = self;
6816            api::PlatformTx {
6817                count: count.into_event(),
6818                syscalls: syscalls.into_event(),
6819                blocked_syscalls: blocked_syscalls.into_event(),
6820                total_errors: total_errors.into_event(),
6821                dropped_errors: dropped_errors.into_event(),
6822            }
6823        }
6824    }
6825    #[derive(Clone, Debug)]
6826    #[doc = " Emitted when the platform returns an error while sending datagrams"]
6827    pub struct PlatformTxError {
6828        #[doc = " The error code returned by the platform"]
6829        pub errno: i32,
6830    }
6831    impl IntoEvent<api::PlatformTxError> for PlatformTxError {
6832        #[inline]
6833        fn into_event(self) -> api::PlatformTxError {
6834            let PlatformTxError { errno } = self;
6835            api::PlatformTxError {
6836                errno: errno.into_event(),
6837            }
6838        }
6839    }
6840    #[derive(Clone, Debug)]
6841    #[doc = " Emitted when the platform receives at least one packet"]
6842    pub struct PlatformRx {
6843        #[doc = " The number of packets received"]
6844        pub count: usize,
6845        #[doc = " The number of syscalls performed"]
6846        pub syscalls: usize,
6847        #[doc = " The number of syscalls that got blocked"]
6848        pub blocked_syscalls: usize,
6849        #[doc = " The total number of errors encountered since the last event"]
6850        pub total_errors: usize,
6851        #[doc = " The number of specific error codes dropped"]
6852        #[doc = ""]
6853        #[doc = " This can happen when a burst of errors exceeds the capacity of the recorder"]
6854        pub dropped_errors: usize,
6855    }
6856    impl IntoEvent<api::PlatformRx> for PlatformRx {
6857        #[inline]
6858        fn into_event(self) -> api::PlatformRx {
6859            let PlatformRx {
6860                count,
6861                syscalls,
6862                blocked_syscalls,
6863                total_errors,
6864                dropped_errors,
6865            } = self;
6866            api::PlatformRx {
6867                count: count.into_event(),
6868                syscalls: syscalls.into_event(),
6869                blocked_syscalls: blocked_syscalls.into_event(),
6870                total_errors: total_errors.into_event(),
6871                dropped_errors: dropped_errors.into_event(),
6872            }
6873        }
6874    }
6875    #[derive(Clone, Debug)]
6876    #[doc = " Emitted when the platform returns an error while receiving datagrams"]
6877    pub struct PlatformRxError {
6878        #[doc = " The error code returned by the platform"]
6879        pub errno: i32,
6880    }
6881    impl IntoEvent<api::PlatformRxError> for PlatformRxError {
6882        #[inline]
6883        fn into_event(self) -> api::PlatformRxError {
6884            let PlatformRxError { errno } = self;
6885            api::PlatformRxError {
6886                errno: errno.into_event(),
6887            }
6888        }
6889    }
6890    #[derive(Clone, Debug)]
6891    #[doc = " Emitted when a platform feature is configured"]
6892    pub struct PlatformFeatureConfigured {
6893        pub configuration: PlatformFeatureConfiguration,
6894    }
6895    impl IntoEvent<api::PlatformFeatureConfigured> for PlatformFeatureConfigured {
6896        #[inline]
6897        fn into_event(self) -> api::PlatformFeatureConfigured {
6898            let PlatformFeatureConfigured { configuration } = self;
6899            api::PlatformFeatureConfigured {
6900                configuration: configuration.into_event(),
6901            }
6902        }
6903    }
6904    #[derive(Clone, Debug)]
6905    pub struct PlatformEventLoopWakeup {
6906        pub timeout_expired: bool,
6907        pub rx_ready: bool,
6908        pub tx_ready: bool,
6909        pub application_wakeup: bool,
6910    }
6911    impl IntoEvent<api::PlatformEventLoopWakeup> for PlatformEventLoopWakeup {
6912        #[inline]
6913        fn into_event(self) -> api::PlatformEventLoopWakeup {
6914            let PlatformEventLoopWakeup {
6915                timeout_expired,
6916                rx_ready,
6917                tx_ready,
6918                application_wakeup,
6919            } = self;
6920            api::PlatformEventLoopWakeup {
6921                timeout_expired: timeout_expired.into_event(),
6922                rx_ready: rx_ready.into_event(),
6923                tx_ready: tx_ready.into_event(),
6924                application_wakeup: application_wakeup.into_event(),
6925            }
6926        }
6927    }
6928    #[derive(Clone, Debug)]
6929    pub struct PlatformEventLoopSleep {
6930        #[doc = " The next time at which the event loop will wake"]
6931        pub timeout: Option<core::time::Duration>,
6932        #[doc = " The amount of time spent processing endpoint events in a single event loop"]
6933        pub processing_duration: core::time::Duration,
6934    }
6935    impl IntoEvent<api::PlatformEventLoopSleep> for PlatformEventLoopSleep {
6936        #[inline]
6937        fn into_event(self) -> api::PlatformEventLoopSleep {
6938            let PlatformEventLoopSleep {
6939                timeout,
6940                processing_duration,
6941            } = self;
6942            api::PlatformEventLoopSleep {
6943                timeout: timeout.into_event(),
6944                processing_duration: processing_duration.into_event(),
6945            }
6946        }
6947    }
6948    #[derive(Clone, Debug)]
6949    pub struct PlatformEventLoopStarted<'a> {
6950        #[doc = " The local address of the socket"]
6951        pub local_address: SocketAddress<'a>,
6952    }
6953    impl<'a> IntoEvent<api::PlatformEventLoopStarted<'a>> for PlatformEventLoopStarted<'a> {
6954        #[inline]
6955        fn into_event(self) -> api::PlatformEventLoopStarted<'a> {
6956            let PlatformEventLoopStarted { local_address } = self;
6957            api::PlatformEventLoopStarted {
6958                local_address: local_address.into_event(),
6959            }
6960        }
6961    }
6962    #[derive(Clone, Debug)]
6963    pub enum PlatformFeatureConfiguration {
6964        #[doc = " Emitted when segment offload was configured"]
6965        Gso {
6966            #[doc = " The maximum number of segments that can be sent in a single GSO packet"]
6967            #[doc = ""]
6968            #[doc = " If this value not greater than 1, GSO is disabled."]
6969            max_segments: usize,
6970        },
6971        #[doc = " Emitted when receive segment offload was configured"]
6972        Gro { enabled: bool },
6973        #[doc = " Emitted when ECN support is configured"]
6974        Ecn { enabled: bool },
6975        #[doc = " Emitted when the base maximum transmission unit is configured"]
6976        BaseMtu { mtu: u16 },
6977        #[doc = " Emitted when the initial maximum transmission unit is configured"]
6978        InitialMtu { mtu: u16 },
6979        #[doc = " Emitted when the max maximum transmission unit is configured"]
6980        MaxMtu { mtu: u16 },
6981    }
6982    impl IntoEvent<api::PlatformFeatureConfiguration> for PlatformFeatureConfiguration {
6983        #[inline]
6984        fn into_event(self) -> api::PlatformFeatureConfiguration {
6985            use api::PlatformFeatureConfiguration::*;
6986            match self {
6987                Self::Gso { max_segments } => Gso {
6988                    max_segments: max_segments.into_event(),
6989                },
6990                Self::Gro { enabled } => Gro {
6991                    enabled: enabled.into_event(),
6992                },
6993                Self::Ecn { enabled } => Ecn {
6994                    enabled: enabled.into_event(),
6995                },
6996                Self::BaseMtu { mtu } => BaseMtu {
6997                    mtu: mtu.into_event(),
6998                },
6999                Self::InitialMtu { mtu } => InitialMtu {
7000                    mtu: mtu.into_event(),
7001                },
7002                Self::MaxMtu { mtu } => MaxMtu {
7003                    mtu: mtu.into_event(),
7004                },
7005            }
7006        }
7007    }
7008}
7009pub mod supervisor {
7010    #![doc = r" This module contains the `supervisor::Outcome` and `supervisor::Context` for use"]
7011    #![doc = r" when implementing [`Subscriber::supervisor_timeout`](crate::event::Subscriber::supervisor_timeout) and"]
7012    #![doc = r" [`Subscriber::on_supervisor_timeout`](crate::event::Subscriber::on_supervisor_timeout)"]
7013    #![doc = r" on a Subscriber."]
7014    use crate::{
7015        application,
7016        event::{builder::SocketAddress, IntoEvent},
7017    };
7018    #[non_exhaustive]
7019    #[derive(Clone, Debug, Default, Eq, PartialEq)]
7020    pub enum Outcome {
7021        #[doc = r" Allow the connection to remain open"]
7022        #[default]
7023        Continue,
7024        #[doc = r" Close the connection and notify the peer"]
7025        Close { error_code: application::Error },
7026        #[doc = r" Close the connection without notifying the peer"]
7027        ImmediateClose { reason: &'static str },
7028    }
7029    #[non_exhaustive]
7030    #[derive(Debug)]
7031    pub struct Context<'a> {
7032        #[doc = r" Number of handshakes that have begun but not completed"]
7033        pub inflight_handshakes: usize,
7034        #[doc = r" Number of open connections"]
7035        pub connection_count: usize,
7036        #[doc = r" The address of the peer"]
7037        pub remote_address: SocketAddress<'a>,
7038        #[doc = r" True if the connection is in the handshake state, false otherwise"]
7039        pub is_handshaking: bool,
7040    }
7041    impl<'a> Context<'a> {
7042        pub fn new(
7043            inflight_handshakes: usize,
7044            connection_count: usize,
7045            remote_address: &'a crate::inet::SocketAddress,
7046            is_handshaking: bool,
7047        ) -> Self {
7048            Self {
7049                inflight_handshakes,
7050                connection_count,
7051                remote_address: remote_address.into_event(),
7052                is_handshaking,
7053            }
7054        }
7055    }
7056}
7057pub use traits::*;
7058mod traits {
7059    use super::*;
7060    use crate::{event::Meta, query};
7061    use core::fmt;
7062    #[doc = r" Allows for events to be subscribed to"]
7063    pub trait Subscriber: 'static + Send {
7064        #[doc = r" An application provided type associated with each connection."]
7065        #[doc = r""]
7066        #[doc = r" The context provides a mechanism for applications to provide a custom type"]
7067        #[doc = r" and update it on each event, e.g. computing statistics. Each event"]
7068        #[doc = r" invocation (e.g. [`Subscriber::on_packet_sent`]) also provides mutable"]
7069        #[doc = r" access to the context `&mut ConnectionContext` and allows for updating the"]
7070        #[doc = r" context."]
7071        #[doc = r""]
7072        #[doc = r" ```no_run"]
7073        #[doc = r" # mod s2n_quic { pub mod provider { pub mod event {"]
7074        #[doc = r" #     pub use s2n_quic_core::event::{api as events, api::ConnectionInfo, api::ConnectionMeta, Subscriber};"]
7075        #[doc = r" # }}}"]
7076        #[doc = r" use s2n_quic::provider::event::{"]
7077        #[doc = r"     ConnectionInfo, ConnectionMeta, Subscriber, events::PacketSent"]
7078        #[doc = r" };"]
7079        #[doc = r""]
7080        #[doc = r" pub struct MyEventSubscriber;"]
7081        #[doc = r""]
7082        #[doc = r" pub struct MyEventContext {"]
7083        #[doc = r"     packet_sent: u64,"]
7084        #[doc = r" }"]
7085        #[doc = r""]
7086        #[doc = r" impl Subscriber for MyEventSubscriber {"]
7087        #[doc = r"     type ConnectionContext = MyEventContext;"]
7088        #[doc = r""]
7089        #[doc = r"     fn create_connection_context("]
7090        #[doc = r"         &mut self, _meta: &ConnectionMeta,"]
7091        #[doc = r"         _info: &ConnectionInfo,"]
7092        #[doc = r"     ) -> Self::ConnectionContext {"]
7093        #[doc = r"         MyEventContext { packet_sent: 0 }"]
7094        #[doc = r"     }"]
7095        #[doc = r""]
7096        #[doc = r"     fn on_packet_sent("]
7097        #[doc = r"         &mut self,"]
7098        #[doc = r"         context: &mut Self::ConnectionContext,"]
7099        #[doc = r"         _meta: &ConnectionMeta,"]
7100        #[doc = r"         _event: &PacketSent,"]
7101        #[doc = r"     ) {"]
7102        #[doc = r"         context.packet_sent += 1;"]
7103        #[doc = r"     }"]
7104        #[doc = r" }"]
7105        #[doc = r"  ```"]
7106        type ConnectionContext: 'static + Send;
7107        #[doc = r" Creates a context to be passed to each connection-related event"]
7108        fn create_connection_context(
7109            &mut self,
7110            meta: &api::ConnectionMeta,
7111            info: &api::ConnectionInfo,
7112        ) -> Self::ConnectionContext;
7113        #[doc = r" The period at which `on_supervisor_timeout` is called"]
7114        #[doc = r""]
7115        #[doc = r" If multiple `event::Subscriber`s are composed together, the minimum `supervisor_timeout`"]
7116        #[doc = r" across all `event::Subscriber`s will be used."]
7117        #[doc = r""]
7118        #[doc = r" If the `supervisor_timeout()` is `None` across all `event::Subscriber`s, connection supervision"]
7119        #[doc = r" will cease for the remaining lifetime of the connection and `on_supervisor_timeout` will no longer"]
7120        #[doc = r" be called."]
7121        #[doc = r""]
7122        #[doc = r" It is recommended to avoid setting this value less than ~100ms, as short durations"]
7123        #[doc = r" may lead to higher CPU utilization."]
7124        #[allow(unused_variables)]
7125        fn supervisor_timeout(
7126            &mut self,
7127            conn_context: &mut Self::ConnectionContext,
7128            meta: &api::ConnectionMeta,
7129            context: &supervisor::Context,
7130        ) -> Option<Duration> {
7131            None
7132        }
7133        #[doc = r" Called for each `supervisor_timeout` to determine any action to take on the connection based on the `supervisor::Outcome`"]
7134        #[doc = r""]
7135        #[doc = r" If multiple `event::Subscriber`s are composed together, the minimum `supervisor_timeout`"]
7136        #[doc = r" across all `event::Subscriber`s will be used, and thus `on_supervisor_timeout` may be called"]
7137        #[doc = r" earlier than the `supervisor_timeout` for a given `event::Subscriber` implementation."]
7138        #[allow(unused_variables)]
7139        fn on_supervisor_timeout(
7140            &mut self,
7141            conn_context: &mut Self::ConnectionContext,
7142            meta: &api::ConnectionMeta,
7143            context: &supervisor::Context,
7144        ) -> supervisor::Outcome {
7145            supervisor::Outcome::default()
7146        }
7147        #[doc = "Called when the `ApplicationProtocolInformation` event is triggered"]
7148        #[inline]
7149        fn on_application_protocol_information(
7150            &mut self,
7151            context: &mut Self::ConnectionContext,
7152            meta: &api::ConnectionMeta,
7153            event: &api::ApplicationProtocolInformation,
7154        ) {
7155            let _ = context;
7156            let _ = meta;
7157            let _ = event;
7158        }
7159        #[doc = "Called when the `ServerNameInformation` event is triggered"]
7160        #[inline]
7161        fn on_server_name_information(
7162            &mut self,
7163            context: &mut Self::ConnectionContext,
7164            meta: &api::ConnectionMeta,
7165            event: &api::ServerNameInformation,
7166        ) {
7167            let _ = context;
7168            let _ = meta;
7169            let _ = event;
7170        }
7171        #[doc = "Called when the `KeyExchangeGroup` event is triggered"]
7172        #[inline]
7173        fn on_key_exchange_group(
7174            &mut self,
7175            context: &mut Self::ConnectionContext,
7176            meta: &api::ConnectionMeta,
7177            event: &api::KeyExchangeGroup,
7178        ) {
7179            let _ = context;
7180            let _ = meta;
7181            let _ = event;
7182        }
7183        #[doc = "Called when the `PacketSkipped` event is triggered"]
7184        #[inline]
7185        fn on_packet_skipped(
7186            &mut self,
7187            context: &mut Self::ConnectionContext,
7188            meta: &api::ConnectionMeta,
7189            event: &api::PacketSkipped,
7190        ) {
7191            let _ = context;
7192            let _ = meta;
7193            let _ = event;
7194        }
7195        #[doc = "Called when the `PacketSent` event is triggered"]
7196        #[inline]
7197        fn on_packet_sent(
7198            &mut self,
7199            context: &mut Self::ConnectionContext,
7200            meta: &api::ConnectionMeta,
7201            event: &api::PacketSent,
7202        ) {
7203            let _ = context;
7204            let _ = meta;
7205            let _ = event;
7206        }
7207        #[doc = "Called when the `PacketReceived` event is triggered"]
7208        #[inline]
7209        fn on_packet_received(
7210            &mut self,
7211            context: &mut Self::ConnectionContext,
7212            meta: &api::ConnectionMeta,
7213            event: &api::PacketReceived,
7214        ) {
7215            let _ = context;
7216            let _ = meta;
7217            let _ = event;
7218        }
7219        #[doc = "Called when the `ActivePathUpdated` event is triggered"]
7220        #[inline]
7221        fn on_active_path_updated(
7222            &mut self,
7223            context: &mut Self::ConnectionContext,
7224            meta: &api::ConnectionMeta,
7225            event: &api::ActivePathUpdated,
7226        ) {
7227            let _ = context;
7228            let _ = meta;
7229            let _ = event;
7230        }
7231        #[doc = "Called when the `PathCreated` event is triggered"]
7232        #[inline]
7233        fn on_path_created(
7234            &mut self,
7235            context: &mut Self::ConnectionContext,
7236            meta: &api::ConnectionMeta,
7237            event: &api::PathCreated,
7238        ) {
7239            let _ = context;
7240            let _ = meta;
7241            let _ = event;
7242        }
7243        #[doc = "Called when the `FrameSent` event is triggered"]
7244        #[inline]
7245        fn on_frame_sent(
7246            &mut self,
7247            context: &mut Self::ConnectionContext,
7248            meta: &api::ConnectionMeta,
7249            event: &api::FrameSent,
7250        ) {
7251            let _ = context;
7252            let _ = meta;
7253            let _ = event;
7254        }
7255        #[doc = "Called when the `FrameReceived` event is triggered"]
7256        #[inline]
7257        fn on_frame_received(
7258            &mut self,
7259            context: &mut Self::ConnectionContext,
7260            meta: &api::ConnectionMeta,
7261            event: &api::FrameReceived,
7262        ) {
7263            let _ = context;
7264            let _ = meta;
7265            let _ = event;
7266        }
7267        #[doc = "Called when the `ConnectionCloseFrameReceived` event is triggered"]
7268        #[inline]
7269        fn on_connection_close_frame_received(
7270            &mut self,
7271            context: &mut Self::ConnectionContext,
7272            meta: &api::ConnectionMeta,
7273            event: &api::ConnectionCloseFrameReceived,
7274        ) {
7275            let _ = context;
7276            let _ = meta;
7277            let _ = event;
7278        }
7279        #[doc = "Called when the `PacketLost` event is triggered"]
7280        #[inline]
7281        fn on_packet_lost(
7282            &mut self,
7283            context: &mut Self::ConnectionContext,
7284            meta: &api::ConnectionMeta,
7285            event: &api::PacketLost,
7286        ) {
7287            let _ = context;
7288            let _ = meta;
7289            let _ = event;
7290        }
7291        #[doc = "Called when the `RecoveryMetrics` event is triggered"]
7292        #[inline]
7293        fn on_recovery_metrics(
7294            &mut self,
7295            context: &mut Self::ConnectionContext,
7296            meta: &api::ConnectionMeta,
7297            event: &api::RecoveryMetrics,
7298        ) {
7299            let _ = context;
7300            let _ = meta;
7301            let _ = event;
7302        }
7303        #[doc = "Called when the `Congestion` event is triggered"]
7304        #[inline]
7305        fn on_congestion(
7306            &mut self,
7307            context: &mut Self::ConnectionContext,
7308            meta: &api::ConnectionMeta,
7309            event: &api::Congestion,
7310        ) {
7311            let _ = context;
7312            let _ = meta;
7313            let _ = event;
7314        }
7315        #[doc = "Called when the `AckProcessed` event is triggered"]
7316        #[inline]
7317        #[deprecated(note = "use on_rx_ack_range_dropped event instead")]
7318        #[allow(deprecated)]
7319        fn on_ack_processed(
7320            &mut self,
7321            context: &mut Self::ConnectionContext,
7322            meta: &api::ConnectionMeta,
7323            event: &api::AckProcessed,
7324        ) {
7325            let _ = context;
7326            let _ = meta;
7327            let _ = event;
7328        }
7329        #[doc = "Called when the `RxAckRangeDropped` event is triggered"]
7330        #[inline]
7331        fn on_rx_ack_range_dropped(
7332            &mut self,
7333            context: &mut Self::ConnectionContext,
7334            meta: &api::ConnectionMeta,
7335            event: &api::RxAckRangeDropped,
7336        ) {
7337            let _ = context;
7338            let _ = meta;
7339            let _ = event;
7340        }
7341        #[doc = "Called when the `AckRangeReceived` event is triggered"]
7342        #[inline]
7343        fn on_ack_range_received(
7344            &mut self,
7345            context: &mut Self::ConnectionContext,
7346            meta: &api::ConnectionMeta,
7347            event: &api::AckRangeReceived,
7348        ) {
7349            let _ = context;
7350            let _ = meta;
7351            let _ = event;
7352        }
7353        #[doc = "Called when the `AckRangeSent` event is triggered"]
7354        #[inline]
7355        fn on_ack_range_sent(
7356            &mut self,
7357            context: &mut Self::ConnectionContext,
7358            meta: &api::ConnectionMeta,
7359            event: &api::AckRangeSent,
7360        ) {
7361            let _ = context;
7362            let _ = meta;
7363            let _ = event;
7364        }
7365        #[doc = "Called when the `PacketDropped` event is triggered"]
7366        #[inline]
7367        fn on_packet_dropped(
7368            &mut self,
7369            context: &mut Self::ConnectionContext,
7370            meta: &api::ConnectionMeta,
7371            event: &api::PacketDropped,
7372        ) {
7373            let _ = context;
7374            let _ = meta;
7375            let _ = event;
7376        }
7377        #[doc = "Called when the `KeyUpdate` event is triggered"]
7378        #[inline]
7379        fn on_key_update(
7380            &mut self,
7381            context: &mut Self::ConnectionContext,
7382            meta: &api::ConnectionMeta,
7383            event: &api::KeyUpdate,
7384        ) {
7385            let _ = context;
7386            let _ = meta;
7387            let _ = event;
7388        }
7389        #[doc = "Called when the `KeySpaceDiscarded` event is triggered"]
7390        #[inline]
7391        fn on_key_space_discarded(
7392            &mut self,
7393            context: &mut Self::ConnectionContext,
7394            meta: &api::ConnectionMeta,
7395            event: &api::KeySpaceDiscarded,
7396        ) {
7397            let _ = context;
7398            let _ = meta;
7399            let _ = event;
7400        }
7401        #[doc = "Called when the `ConnectionStarted` event is triggered"]
7402        #[inline]
7403        fn on_connection_started(
7404            &mut self,
7405            context: &mut Self::ConnectionContext,
7406            meta: &api::ConnectionMeta,
7407            event: &api::ConnectionStarted,
7408        ) {
7409            let _ = context;
7410            let _ = meta;
7411            let _ = event;
7412        }
7413        #[doc = "Called when the `DuplicatePacket` event is triggered"]
7414        #[inline]
7415        fn on_duplicate_packet(
7416            &mut self,
7417            context: &mut Self::ConnectionContext,
7418            meta: &api::ConnectionMeta,
7419            event: &api::DuplicatePacket,
7420        ) {
7421            let _ = context;
7422            let _ = meta;
7423            let _ = event;
7424        }
7425        #[doc = "Called when the `TransportParametersReceived` event is triggered"]
7426        #[inline]
7427        fn on_transport_parameters_received(
7428            &mut self,
7429            context: &mut Self::ConnectionContext,
7430            meta: &api::ConnectionMeta,
7431            event: &api::TransportParametersReceived,
7432        ) {
7433            let _ = context;
7434            let _ = meta;
7435            let _ = event;
7436        }
7437        #[doc = "Called when the `DatagramSent` event is triggered"]
7438        #[inline]
7439        fn on_datagram_sent(
7440            &mut self,
7441            context: &mut Self::ConnectionContext,
7442            meta: &api::ConnectionMeta,
7443            event: &api::DatagramSent,
7444        ) {
7445            let _ = context;
7446            let _ = meta;
7447            let _ = event;
7448        }
7449        #[doc = "Called when the `DatagramReceived` event is triggered"]
7450        #[inline]
7451        fn on_datagram_received(
7452            &mut self,
7453            context: &mut Self::ConnectionContext,
7454            meta: &api::ConnectionMeta,
7455            event: &api::DatagramReceived,
7456        ) {
7457            let _ = context;
7458            let _ = meta;
7459            let _ = event;
7460        }
7461        #[doc = "Called when the `DatagramDropped` event is triggered"]
7462        #[inline]
7463        fn on_datagram_dropped(
7464            &mut self,
7465            context: &mut Self::ConnectionContext,
7466            meta: &api::ConnectionMeta,
7467            event: &api::DatagramDropped,
7468        ) {
7469            let _ = context;
7470            let _ = meta;
7471            let _ = event;
7472        }
7473        #[doc = "Called when the `HandshakeRemoteAddressChangeObserved` event is triggered"]
7474        #[inline]
7475        fn on_handshake_remote_address_change_observed(
7476            &mut self,
7477            context: &mut Self::ConnectionContext,
7478            meta: &api::ConnectionMeta,
7479            event: &api::HandshakeRemoteAddressChangeObserved,
7480        ) {
7481            let _ = context;
7482            let _ = meta;
7483            let _ = event;
7484        }
7485        #[doc = "Called when the `ConnectionIdUpdated` event is triggered"]
7486        #[inline]
7487        fn on_connection_id_updated(
7488            &mut self,
7489            context: &mut Self::ConnectionContext,
7490            meta: &api::ConnectionMeta,
7491            event: &api::ConnectionIdUpdated,
7492        ) {
7493            let _ = context;
7494            let _ = meta;
7495            let _ = event;
7496        }
7497        #[doc = "Called when the `EcnStateChanged` event is triggered"]
7498        #[inline]
7499        fn on_ecn_state_changed(
7500            &mut self,
7501            context: &mut Self::ConnectionContext,
7502            meta: &api::ConnectionMeta,
7503            event: &api::EcnStateChanged,
7504        ) {
7505            let _ = context;
7506            let _ = meta;
7507            let _ = event;
7508        }
7509        #[doc = "Called when the `ConnectionMigrationDenied` event is triggered"]
7510        #[inline]
7511        fn on_connection_migration_denied(
7512            &mut self,
7513            context: &mut Self::ConnectionContext,
7514            meta: &api::ConnectionMeta,
7515            event: &api::ConnectionMigrationDenied,
7516        ) {
7517            let _ = context;
7518            let _ = meta;
7519            let _ = event;
7520        }
7521        #[doc = "Called when the `HandshakeStatusUpdated` event is triggered"]
7522        #[inline]
7523        fn on_handshake_status_updated(
7524            &mut self,
7525            context: &mut Self::ConnectionContext,
7526            meta: &api::ConnectionMeta,
7527            event: &api::HandshakeStatusUpdated,
7528        ) {
7529            let _ = context;
7530            let _ = meta;
7531            let _ = event;
7532        }
7533        #[doc = "Called when the `TlsExporterReady` event is triggered"]
7534        #[inline]
7535        fn on_tls_exporter_ready(
7536            &mut self,
7537            context: &mut Self::ConnectionContext,
7538            meta: &api::ConnectionMeta,
7539            event: &api::TlsExporterReady,
7540        ) {
7541            let _ = context;
7542            let _ = meta;
7543            let _ = event;
7544        }
7545        #[doc = "Called when the `TlsHandshakeFailed` event is triggered"]
7546        #[inline]
7547        fn on_tls_handshake_failed(
7548            &mut self,
7549            context: &mut Self::ConnectionContext,
7550            meta: &api::ConnectionMeta,
7551            event: &api::TlsHandshakeFailed,
7552        ) {
7553            let _ = context;
7554            let _ = meta;
7555            let _ = event;
7556        }
7557        #[doc = "Called when the `PathChallengeUpdated` event is triggered"]
7558        #[inline]
7559        fn on_path_challenge_updated(
7560            &mut self,
7561            context: &mut Self::ConnectionContext,
7562            meta: &api::ConnectionMeta,
7563            event: &api::PathChallengeUpdated,
7564        ) {
7565            let _ = context;
7566            let _ = meta;
7567            let _ = event;
7568        }
7569        #[doc = "Called when the `TlsClientHello` event is triggered"]
7570        #[inline]
7571        fn on_tls_client_hello(
7572            &mut self,
7573            context: &mut Self::ConnectionContext,
7574            meta: &api::ConnectionMeta,
7575            event: &api::TlsClientHello,
7576        ) {
7577            let _ = context;
7578            let _ = meta;
7579            let _ = event;
7580        }
7581        #[doc = "Called when the `TlsServerHello` event is triggered"]
7582        #[inline]
7583        fn on_tls_server_hello(
7584            &mut self,
7585            context: &mut Self::ConnectionContext,
7586            meta: &api::ConnectionMeta,
7587            event: &api::TlsServerHello,
7588        ) {
7589            let _ = context;
7590            let _ = meta;
7591            let _ = event;
7592        }
7593        #[doc = "Called when the `RxStreamProgress` event is triggered"]
7594        #[inline]
7595        fn on_rx_stream_progress(
7596            &mut self,
7597            context: &mut Self::ConnectionContext,
7598            meta: &api::ConnectionMeta,
7599            event: &api::RxStreamProgress,
7600        ) {
7601            let _ = context;
7602            let _ = meta;
7603            let _ = event;
7604        }
7605        #[doc = "Called when the `TxStreamProgress` event is triggered"]
7606        #[inline]
7607        fn on_tx_stream_progress(
7608            &mut self,
7609            context: &mut Self::ConnectionContext,
7610            meta: &api::ConnectionMeta,
7611            event: &api::TxStreamProgress,
7612        ) {
7613            let _ = context;
7614            let _ = meta;
7615            let _ = event;
7616        }
7617        #[doc = "Called when the `KeepAliveTimerExpired` event is triggered"]
7618        #[inline]
7619        fn on_keep_alive_timer_expired(
7620            &mut self,
7621            context: &mut Self::ConnectionContext,
7622            meta: &api::ConnectionMeta,
7623            event: &api::KeepAliveTimerExpired,
7624        ) {
7625            let _ = context;
7626            let _ = meta;
7627            let _ = event;
7628        }
7629        #[doc = "Called when the `MtuUpdated` event is triggered"]
7630        #[inline]
7631        fn on_mtu_updated(
7632            &mut self,
7633            context: &mut Self::ConnectionContext,
7634            meta: &api::ConnectionMeta,
7635            event: &api::MtuUpdated,
7636        ) {
7637            let _ = context;
7638            let _ = meta;
7639            let _ = event;
7640        }
7641        #[doc = "Called when the `MtuProbingCompleteReceived` event is triggered"]
7642        #[inline]
7643        fn on_mtu_probing_complete_received(
7644            &mut self,
7645            context: &mut Self::ConnectionContext,
7646            meta: &api::ConnectionMeta,
7647            event: &api::MtuProbingCompleteReceived,
7648        ) {
7649            let _ = context;
7650            let _ = meta;
7651            let _ = event;
7652        }
7653        #[doc = "Called when the `SlowStartExited` event is triggered"]
7654        #[inline]
7655        fn on_slow_start_exited(
7656            &mut self,
7657            context: &mut Self::ConnectionContext,
7658            meta: &api::ConnectionMeta,
7659            event: &api::SlowStartExited,
7660        ) {
7661            let _ = context;
7662            let _ = meta;
7663            let _ = event;
7664        }
7665        #[doc = "Called when the `DeliveryRateSampled` event is triggered"]
7666        #[inline]
7667        fn on_delivery_rate_sampled(
7668            &mut self,
7669            context: &mut Self::ConnectionContext,
7670            meta: &api::ConnectionMeta,
7671            event: &api::DeliveryRateSampled,
7672        ) {
7673            let _ = context;
7674            let _ = meta;
7675            let _ = event;
7676        }
7677        #[doc = "Called when the `PacingRateUpdated` event is triggered"]
7678        #[inline]
7679        fn on_pacing_rate_updated(
7680            &mut self,
7681            context: &mut Self::ConnectionContext,
7682            meta: &api::ConnectionMeta,
7683            event: &api::PacingRateUpdated,
7684        ) {
7685            let _ = context;
7686            let _ = meta;
7687            let _ = event;
7688        }
7689        #[doc = "Called when the `BbrStateChanged` event is triggered"]
7690        #[inline]
7691        fn on_bbr_state_changed(
7692            &mut self,
7693            context: &mut Self::ConnectionContext,
7694            meta: &api::ConnectionMeta,
7695            event: &api::BbrStateChanged,
7696        ) {
7697            let _ = context;
7698            let _ = meta;
7699            let _ = event;
7700        }
7701        #[doc = "Called when the `DcStateChanged` event is triggered"]
7702        #[inline]
7703        fn on_dc_state_changed(
7704            &mut self,
7705            context: &mut Self::ConnectionContext,
7706            meta: &api::ConnectionMeta,
7707            event: &api::DcStateChanged,
7708        ) {
7709            let _ = context;
7710            let _ = meta;
7711            let _ = event;
7712        }
7713        #[doc = "Called when the `DcPathCreated` event is triggered"]
7714        #[inline]
7715        fn on_dc_path_created(
7716            &mut self,
7717            context: &mut Self::ConnectionContext,
7718            meta: &api::ConnectionMeta,
7719            event: &api::DcPathCreated,
7720        ) {
7721            let _ = context;
7722            let _ = meta;
7723            let _ = event;
7724        }
7725        #[doc = "Called when the `ConnectionClosed` event is triggered"]
7726        #[inline]
7727        fn on_connection_closed(
7728            &mut self,
7729            context: &mut Self::ConnectionContext,
7730            meta: &api::ConnectionMeta,
7731            event: &api::ConnectionClosed,
7732        ) {
7733            let _ = context;
7734            let _ = meta;
7735            let _ = event;
7736        }
7737        #[doc = "Called when the `VersionInformation` event is triggered"]
7738        #[inline]
7739        fn on_version_information(
7740            &mut self,
7741            meta: &api::EndpointMeta,
7742            event: &api::VersionInformation,
7743        ) {
7744            let _ = meta;
7745            let _ = event;
7746        }
7747        #[doc = "Called when the `EndpointPacketSent` event is triggered"]
7748        #[inline]
7749        fn on_endpoint_packet_sent(
7750            &mut self,
7751            meta: &api::EndpointMeta,
7752            event: &api::EndpointPacketSent,
7753        ) {
7754            let _ = meta;
7755            let _ = event;
7756        }
7757        #[doc = "Called when the `EndpointPacketReceived` event is triggered"]
7758        #[inline]
7759        fn on_endpoint_packet_received(
7760            &mut self,
7761            meta: &api::EndpointMeta,
7762            event: &api::EndpointPacketReceived,
7763        ) {
7764            let _ = meta;
7765            let _ = event;
7766        }
7767        #[doc = "Called when the `EndpointDatagramSent` event is triggered"]
7768        #[inline]
7769        fn on_endpoint_datagram_sent(
7770            &mut self,
7771            meta: &api::EndpointMeta,
7772            event: &api::EndpointDatagramSent,
7773        ) {
7774            let _ = meta;
7775            let _ = event;
7776        }
7777        #[doc = "Called when the `EndpointDatagramReceived` event is triggered"]
7778        #[inline]
7779        fn on_endpoint_datagram_received(
7780            &mut self,
7781            meta: &api::EndpointMeta,
7782            event: &api::EndpointDatagramReceived,
7783        ) {
7784            let _ = meta;
7785            let _ = event;
7786        }
7787        #[doc = "Called when the `EndpointDatagramDropped` event is triggered"]
7788        #[inline]
7789        fn on_endpoint_datagram_dropped(
7790            &mut self,
7791            meta: &api::EndpointMeta,
7792            event: &api::EndpointDatagramDropped,
7793        ) {
7794            let _ = meta;
7795            let _ = event;
7796        }
7797        #[doc = "Called when the `EndpointConnectionAttemptFailed` event is triggered"]
7798        #[inline]
7799        fn on_endpoint_connection_attempt_failed(
7800            &mut self,
7801            meta: &api::EndpointMeta,
7802            event: &api::EndpointConnectionAttemptFailed,
7803        ) {
7804            let _ = meta;
7805            let _ = event;
7806        }
7807        #[doc = "Called when the `EndpointConnectionAttemptDeduplicated` event is triggered"]
7808        #[inline]
7809        fn on_endpoint_connection_attempt_deduplicated(
7810            &mut self,
7811            meta: &api::EndpointMeta,
7812            event: &api::EndpointConnectionAttemptDeduplicated,
7813        ) {
7814            let _ = meta;
7815            let _ = event;
7816        }
7817        #[doc = "Called when the `PlatformTx` event is triggered"]
7818        #[inline]
7819        fn on_platform_tx(&mut self, meta: &api::EndpointMeta, event: &api::PlatformTx) {
7820            let _ = meta;
7821            let _ = event;
7822        }
7823        #[doc = "Called when the `PlatformTxError` event is triggered"]
7824        #[inline]
7825        fn on_platform_tx_error(&mut self, meta: &api::EndpointMeta, event: &api::PlatformTxError) {
7826            let _ = meta;
7827            let _ = event;
7828        }
7829        #[doc = "Called when the `PlatformRx` event is triggered"]
7830        #[inline]
7831        fn on_platform_rx(&mut self, meta: &api::EndpointMeta, event: &api::PlatformRx) {
7832            let _ = meta;
7833            let _ = event;
7834        }
7835        #[doc = "Called when the `PlatformRxError` event is triggered"]
7836        #[inline]
7837        fn on_platform_rx_error(&mut self, meta: &api::EndpointMeta, event: &api::PlatformRxError) {
7838            let _ = meta;
7839            let _ = event;
7840        }
7841        #[doc = "Called when the `PlatformFeatureConfigured` event is triggered"]
7842        #[inline]
7843        fn on_platform_feature_configured(
7844            &mut self,
7845            meta: &api::EndpointMeta,
7846            event: &api::PlatformFeatureConfigured,
7847        ) {
7848            let _ = meta;
7849            let _ = event;
7850        }
7851        #[doc = "Called when the `PlatformEventLoopWakeup` event is triggered"]
7852        #[inline]
7853        fn on_platform_event_loop_wakeup(
7854            &mut self,
7855            meta: &api::EndpointMeta,
7856            event: &api::PlatformEventLoopWakeup,
7857        ) {
7858            let _ = meta;
7859            let _ = event;
7860        }
7861        #[doc = "Called when the `PlatformEventLoopSleep` event is triggered"]
7862        #[inline]
7863        fn on_platform_event_loop_sleep(
7864            &mut self,
7865            meta: &api::EndpointMeta,
7866            event: &api::PlatformEventLoopSleep,
7867        ) {
7868            let _ = meta;
7869            let _ = event;
7870        }
7871        #[doc = "Called when the `PlatformEventLoopStarted` event is triggered"]
7872        #[inline]
7873        fn on_platform_event_loop_started(
7874            &mut self,
7875            meta: &api::EndpointMeta,
7876            event: &api::PlatformEventLoopStarted,
7877        ) {
7878            let _ = meta;
7879            let _ = event;
7880        }
7881        #[doc = r" Called for each event that relates to the endpoint and all connections"]
7882        #[inline]
7883        fn on_event<M: Meta, E: Event>(&mut self, meta: &M, event: &E) {
7884            let _ = meta;
7885            let _ = event;
7886        }
7887        #[doc = r" Called for each event that relates to a connection"]
7888        #[inline]
7889        fn on_connection_event<E: Event>(
7890            &mut self,
7891            context: &mut Self::ConnectionContext,
7892            meta: &api::ConnectionMeta,
7893            event: &E,
7894        ) {
7895            let _ = context;
7896            let _ = meta;
7897            let _ = event;
7898        }
7899        #[doc = r" Used for querying the `Subscriber::ConnectionContext` on a Subscriber"]
7900        #[inline]
7901        fn query(
7902            context: &Self::ConnectionContext,
7903            query: &mut dyn query::Query,
7904        ) -> query::ControlFlow {
7905            query.execute(context)
7906        }
7907        #[doc = r" Used for querying and mutating the `Subscriber::ConnectionContext` on a Subscriber"]
7908        #[inline]
7909        fn query_mut(
7910            context: &mut Self::ConnectionContext,
7911            query: &mut dyn query::QueryMut,
7912        ) -> query::ControlFlow {
7913            query.execute_mut(context)
7914        }
7915    }
7916    #[doc = r" Subscriber is implemented for a 2-element tuple to make it easy to compose multiple"]
7917    #[doc = r" subscribers."]
7918    impl<A, B> Subscriber for (A, B)
7919    where
7920        A: Subscriber,
7921        B: Subscriber,
7922    {
7923        type ConnectionContext = (A::ConnectionContext, B::ConnectionContext);
7924        #[inline]
7925        fn create_connection_context(
7926            &mut self,
7927            meta: &api::ConnectionMeta,
7928            info: &api::ConnectionInfo,
7929        ) -> Self::ConnectionContext {
7930            (
7931                self.0.create_connection_context(meta, info),
7932                self.1.create_connection_context(meta, info),
7933            )
7934        }
7935        #[inline]
7936        fn supervisor_timeout(
7937            &mut self,
7938            conn_context: &mut Self::ConnectionContext,
7939            meta: &api::ConnectionMeta,
7940            context: &supervisor::Context,
7941        ) -> Option<Duration> {
7942            let timeout_a = self
7943                .0
7944                .supervisor_timeout(&mut conn_context.0, meta, context);
7945            let timeout_b = self
7946                .1
7947                .supervisor_timeout(&mut conn_context.1, meta, context);
7948            match (timeout_a, timeout_b) {
7949                (None, None) => None,
7950                (None, Some(timeout)) | (Some(timeout), None) => Some(timeout),
7951                (Some(a), Some(b)) => Some(a.min(b)),
7952            }
7953        }
7954        #[inline]
7955        fn on_supervisor_timeout(
7956            &mut self,
7957            conn_context: &mut Self::ConnectionContext,
7958            meta: &api::ConnectionMeta,
7959            context: &supervisor::Context,
7960        ) -> supervisor::Outcome {
7961            let outcome_a = self
7962                .0
7963                .on_supervisor_timeout(&mut conn_context.0, meta, context);
7964            let outcome_b = self
7965                .1
7966                .on_supervisor_timeout(&mut conn_context.1, meta, context);
7967            match (outcome_a, outcome_b) {
7968                (supervisor::Outcome::ImmediateClose { reason }, _)
7969                | (_, supervisor::Outcome::ImmediateClose { reason }) => {
7970                    supervisor::Outcome::ImmediateClose { reason }
7971                }
7972                (supervisor::Outcome::Close { error_code }, _)
7973                | (_, supervisor::Outcome::Close { error_code }) => {
7974                    supervisor::Outcome::Close { error_code }
7975                }
7976                _ => supervisor::Outcome::Continue,
7977            }
7978        }
7979        #[inline]
7980        fn on_application_protocol_information(
7981            &mut self,
7982            context: &mut Self::ConnectionContext,
7983            meta: &api::ConnectionMeta,
7984            event: &api::ApplicationProtocolInformation,
7985        ) {
7986            (self.0).on_application_protocol_information(&mut context.0, meta, event);
7987            (self.1).on_application_protocol_information(&mut context.1, meta, event);
7988        }
7989        #[inline]
7990        fn on_server_name_information(
7991            &mut self,
7992            context: &mut Self::ConnectionContext,
7993            meta: &api::ConnectionMeta,
7994            event: &api::ServerNameInformation,
7995        ) {
7996            (self.0).on_server_name_information(&mut context.0, meta, event);
7997            (self.1).on_server_name_information(&mut context.1, meta, event);
7998        }
7999        #[inline]
8000        fn on_key_exchange_group(
8001            &mut self,
8002            context: &mut Self::ConnectionContext,
8003            meta: &api::ConnectionMeta,
8004            event: &api::KeyExchangeGroup,
8005        ) {
8006            (self.0).on_key_exchange_group(&mut context.0, meta, event);
8007            (self.1).on_key_exchange_group(&mut context.1, meta, event);
8008        }
8009        #[inline]
8010        fn on_packet_skipped(
8011            &mut self,
8012            context: &mut Self::ConnectionContext,
8013            meta: &api::ConnectionMeta,
8014            event: &api::PacketSkipped,
8015        ) {
8016            (self.0).on_packet_skipped(&mut context.0, meta, event);
8017            (self.1).on_packet_skipped(&mut context.1, meta, event);
8018        }
8019        #[inline]
8020        fn on_packet_sent(
8021            &mut self,
8022            context: &mut Self::ConnectionContext,
8023            meta: &api::ConnectionMeta,
8024            event: &api::PacketSent,
8025        ) {
8026            (self.0).on_packet_sent(&mut context.0, meta, event);
8027            (self.1).on_packet_sent(&mut context.1, meta, event);
8028        }
8029        #[inline]
8030        fn on_packet_received(
8031            &mut self,
8032            context: &mut Self::ConnectionContext,
8033            meta: &api::ConnectionMeta,
8034            event: &api::PacketReceived,
8035        ) {
8036            (self.0).on_packet_received(&mut context.0, meta, event);
8037            (self.1).on_packet_received(&mut context.1, meta, event);
8038        }
8039        #[inline]
8040        fn on_active_path_updated(
8041            &mut self,
8042            context: &mut Self::ConnectionContext,
8043            meta: &api::ConnectionMeta,
8044            event: &api::ActivePathUpdated,
8045        ) {
8046            (self.0).on_active_path_updated(&mut context.0, meta, event);
8047            (self.1).on_active_path_updated(&mut context.1, meta, event);
8048        }
8049        #[inline]
8050        fn on_path_created(
8051            &mut self,
8052            context: &mut Self::ConnectionContext,
8053            meta: &api::ConnectionMeta,
8054            event: &api::PathCreated,
8055        ) {
8056            (self.0).on_path_created(&mut context.0, meta, event);
8057            (self.1).on_path_created(&mut context.1, meta, event);
8058        }
8059        #[inline]
8060        fn on_frame_sent(
8061            &mut self,
8062            context: &mut Self::ConnectionContext,
8063            meta: &api::ConnectionMeta,
8064            event: &api::FrameSent,
8065        ) {
8066            (self.0).on_frame_sent(&mut context.0, meta, event);
8067            (self.1).on_frame_sent(&mut context.1, meta, event);
8068        }
8069        #[inline]
8070        fn on_frame_received(
8071            &mut self,
8072            context: &mut Self::ConnectionContext,
8073            meta: &api::ConnectionMeta,
8074            event: &api::FrameReceived,
8075        ) {
8076            (self.0).on_frame_received(&mut context.0, meta, event);
8077            (self.1).on_frame_received(&mut context.1, meta, event);
8078        }
8079        #[inline]
8080        fn on_connection_close_frame_received(
8081            &mut self,
8082            context: &mut Self::ConnectionContext,
8083            meta: &api::ConnectionMeta,
8084            event: &api::ConnectionCloseFrameReceived,
8085        ) {
8086            (self.0).on_connection_close_frame_received(&mut context.0, meta, event);
8087            (self.1).on_connection_close_frame_received(&mut context.1, meta, event);
8088        }
8089        #[inline]
8090        fn on_packet_lost(
8091            &mut self,
8092            context: &mut Self::ConnectionContext,
8093            meta: &api::ConnectionMeta,
8094            event: &api::PacketLost,
8095        ) {
8096            (self.0).on_packet_lost(&mut context.0, meta, event);
8097            (self.1).on_packet_lost(&mut context.1, meta, event);
8098        }
8099        #[inline]
8100        fn on_recovery_metrics(
8101            &mut self,
8102            context: &mut Self::ConnectionContext,
8103            meta: &api::ConnectionMeta,
8104            event: &api::RecoveryMetrics,
8105        ) {
8106            (self.0).on_recovery_metrics(&mut context.0, meta, event);
8107            (self.1).on_recovery_metrics(&mut context.1, meta, event);
8108        }
8109        #[inline]
8110        fn on_congestion(
8111            &mut self,
8112            context: &mut Self::ConnectionContext,
8113            meta: &api::ConnectionMeta,
8114            event: &api::Congestion,
8115        ) {
8116            (self.0).on_congestion(&mut context.0, meta, event);
8117            (self.1).on_congestion(&mut context.1, meta, event);
8118        }
8119        #[inline]
8120        #[allow(deprecated)]
8121        fn on_ack_processed(
8122            &mut self,
8123            context: &mut Self::ConnectionContext,
8124            meta: &api::ConnectionMeta,
8125            event: &api::AckProcessed,
8126        ) {
8127            (self.0).on_ack_processed(&mut context.0, meta, event);
8128            (self.1).on_ack_processed(&mut context.1, meta, event);
8129        }
8130        #[inline]
8131        fn on_rx_ack_range_dropped(
8132            &mut self,
8133            context: &mut Self::ConnectionContext,
8134            meta: &api::ConnectionMeta,
8135            event: &api::RxAckRangeDropped,
8136        ) {
8137            (self.0).on_rx_ack_range_dropped(&mut context.0, meta, event);
8138            (self.1).on_rx_ack_range_dropped(&mut context.1, meta, event);
8139        }
8140        #[inline]
8141        fn on_ack_range_received(
8142            &mut self,
8143            context: &mut Self::ConnectionContext,
8144            meta: &api::ConnectionMeta,
8145            event: &api::AckRangeReceived,
8146        ) {
8147            (self.0).on_ack_range_received(&mut context.0, meta, event);
8148            (self.1).on_ack_range_received(&mut context.1, meta, event);
8149        }
8150        #[inline]
8151        fn on_ack_range_sent(
8152            &mut self,
8153            context: &mut Self::ConnectionContext,
8154            meta: &api::ConnectionMeta,
8155            event: &api::AckRangeSent,
8156        ) {
8157            (self.0).on_ack_range_sent(&mut context.0, meta, event);
8158            (self.1).on_ack_range_sent(&mut context.1, meta, event);
8159        }
8160        #[inline]
8161        fn on_packet_dropped(
8162            &mut self,
8163            context: &mut Self::ConnectionContext,
8164            meta: &api::ConnectionMeta,
8165            event: &api::PacketDropped,
8166        ) {
8167            (self.0).on_packet_dropped(&mut context.0, meta, event);
8168            (self.1).on_packet_dropped(&mut context.1, meta, event);
8169        }
8170        #[inline]
8171        fn on_key_update(
8172            &mut self,
8173            context: &mut Self::ConnectionContext,
8174            meta: &api::ConnectionMeta,
8175            event: &api::KeyUpdate,
8176        ) {
8177            (self.0).on_key_update(&mut context.0, meta, event);
8178            (self.1).on_key_update(&mut context.1, meta, event);
8179        }
8180        #[inline]
8181        fn on_key_space_discarded(
8182            &mut self,
8183            context: &mut Self::ConnectionContext,
8184            meta: &api::ConnectionMeta,
8185            event: &api::KeySpaceDiscarded,
8186        ) {
8187            (self.0).on_key_space_discarded(&mut context.0, meta, event);
8188            (self.1).on_key_space_discarded(&mut context.1, meta, event);
8189        }
8190        #[inline]
8191        fn on_connection_started(
8192            &mut self,
8193            context: &mut Self::ConnectionContext,
8194            meta: &api::ConnectionMeta,
8195            event: &api::ConnectionStarted,
8196        ) {
8197            (self.0).on_connection_started(&mut context.0, meta, event);
8198            (self.1).on_connection_started(&mut context.1, meta, event);
8199        }
8200        #[inline]
8201        fn on_duplicate_packet(
8202            &mut self,
8203            context: &mut Self::ConnectionContext,
8204            meta: &api::ConnectionMeta,
8205            event: &api::DuplicatePacket,
8206        ) {
8207            (self.0).on_duplicate_packet(&mut context.0, meta, event);
8208            (self.1).on_duplicate_packet(&mut context.1, meta, event);
8209        }
8210        #[inline]
8211        fn on_transport_parameters_received(
8212            &mut self,
8213            context: &mut Self::ConnectionContext,
8214            meta: &api::ConnectionMeta,
8215            event: &api::TransportParametersReceived,
8216        ) {
8217            (self.0).on_transport_parameters_received(&mut context.0, meta, event);
8218            (self.1).on_transport_parameters_received(&mut context.1, meta, event);
8219        }
8220        #[inline]
8221        fn on_datagram_sent(
8222            &mut self,
8223            context: &mut Self::ConnectionContext,
8224            meta: &api::ConnectionMeta,
8225            event: &api::DatagramSent,
8226        ) {
8227            (self.0).on_datagram_sent(&mut context.0, meta, event);
8228            (self.1).on_datagram_sent(&mut context.1, meta, event);
8229        }
8230        #[inline]
8231        fn on_datagram_received(
8232            &mut self,
8233            context: &mut Self::ConnectionContext,
8234            meta: &api::ConnectionMeta,
8235            event: &api::DatagramReceived,
8236        ) {
8237            (self.0).on_datagram_received(&mut context.0, meta, event);
8238            (self.1).on_datagram_received(&mut context.1, meta, event);
8239        }
8240        #[inline]
8241        fn on_datagram_dropped(
8242            &mut self,
8243            context: &mut Self::ConnectionContext,
8244            meta: &api::ConnectionMeta,
8245            event: &api::DatagramDropped,
8246        ) {
8247            (self.0).on_datagram_dropped(&mut context.0, meta, event);
8248            (self.1).on_datagram_dropped(&mut context.1, meta, event);
8249        }
8250        #[inline]
8251        fn on_handshake_remote_address_change_observed(
8252            &mut self,
8253            context: &mut Self::ConnectionContext,
8254            meta: &api::ConnectionMeta,
8255            event: &api::HandshakeRemoteAddressChangeObserved,
8256        ) {
8257            (self.0).on_handshake_remote_address_change_observed(&mut context.0, meta, event);
8258            (self.1).on_handshake_remote_address_change_observed(&mut context.1, meta, event);
8259        }
8260        #[inline]
8261        fn on_connection_id_updated(
8262            &mut self,
8263            context: &mut Self::ConnectionContext,
8264            meta: &api::ConnectionMeta,
8265            event: &api::ConnectionIdUpdated,
8266        ) {
8267            (self.0).on_connection_id_updated(&mut context.0, meta, event);
8268            (self.1).on_connection_id_updated(&mut context.1, meta, event);
8269        }
8270        #[inline]
8271        fn on_ecn_state_changed(
8272            &mut self,
8273            context: &mut Self::ConnectionContext,
8274            meta: &api::ConnectionMeta,
8275            event: &api::EcnStateChanged,
8276        ) {
8277            (self.0).on_ecn_state_changed(&mut context.0, meta, event);
8278            (self.1).on_ecn_state_changed(&mut context.1, meta, event);
8279        }
8280        #[inline]
8281        fn on_connection_migration_denied(
8282            &mut self,
8283            context: &mut Self::ConnectionContext,
8284            meta: &api::ConnectionMeta,
8285            event: &api::ConnectionMigrationDenied,
8286        ) {
8287            (self.0).on_connection_migration_denied(&mut context.0, meta, event);
8288            (self.1).on_connection_migration_denied(&mut context.1, meta, event);
8289        }
8290        #[inline]
8291        fn on_handshake_status_updated(
8292            &mut self,
8293            context: &mut Self::ConnectionContext,
8294            meta: &api::ConnectionMeta,
8295            event: &api::HandshakeStatusUpdated,
8296        ) {
8297            (self.0).on_handshake_status_updated(&mut context.0, meta, event);
8298            (self.1).on_handshake_status_updated(&mut context.1, meta, event);
8299        }
8300        #[inline]
8301        fn on_tls_exporter_ready(
8302            &mut self,
8303            context: &mut Self::ConnectionContext,
8304            meta: &api::ConnectionMeta,
8305            event: &api::TlsExporterReady,
8306        ) {
8307            (self.0).on_tls_exporter_ready(&mut context.0, meta, event);
8308            (self.1).on_tls_exporter_ready(&mut context.1, meta, event);
8309        }
8310        #[inline]
8311        fn on_tls_handshake_failed(
8312            &mut self,
8313            context: &mut Self::ConnectionContext,
8314            meta: &api::ConnectionMeta,
8315            event: &api::TlsHandshakeFailed,
8316        ) {
8317            (self.0).on_tls_handshake_failed(&mut context.0, meta, event);
8318            (self.1).on_tls_handshake_failed(&mut context.1, meta, event);
8319        }
8320        #[inline]
8321        fn on_path_challenge_updated(
8322            &mut self,
8323            context: &mut Self::ConnectionContext,
8324            meta: &api::ConnectionMeta,
8325            event: &api::PathChallengeUpdated,
8326        ) {
8327            (self.0).on_path_challenge_updated(&mut context.0, meta, event);
8328            (self.1).on_path_challenge_updated(&mut context.1, meta, event);
8329        }
8330        #[inline]
8331        fn on_tls_client_hello(
8332            &mut self,
8333            context: &mut Self::ConnectionContext,
8334            meta: &api::ConnectionMeta,
8335            event: &api::TlsClientHello,
8336        ) {
8337            (self.0).on_tls_client_hello(&mut context.0, meta, event);
8338            (self.1).on_tls_client_hello(&mut context.1, meta, event);
8339        }
8340        #[inline]
8341        fn on_tls_server_hello(
8342            &mut self,
8343            context: &mut Self::ConnectionContext,
8344            meta: &api::ConnectionMeta,
8345            event: &api::TlsServerHello,
8346        ) {
8347            (self.0).on_tls_server_hello(&mut context.0, meta, event);
8348            (self.1).on_tls_server_hello(&mut context.1, meta, event);
8349        }
8350        #[inline]
8351        fn on_rx_stream_progress(
8352            &mut self,
8353            context: &mut Self::ConnectionContext,
8354            meta: &api::ConnectionMeta,
8355            event: &api::RxStreamProgress,
8356        ) {
8357            (self.0).on_rx_stream_progress(&mut context.0, meta, event);
8358            (self.1).on_rx_stream_progress(&mut context.1, meta, event);
8359        }
8360        #[inline]
8361        fn on_tx_stream_progress(
8362            &mut self,
8363            context: &mut Self::ConnectionContext,
8364            meta: &api::ConnectionMeta,
8365            event: &api::TxStreamProgress,
8366        ) {
8367            (self.0).on_tx_stream_progress(&mut context.0, meta, event);
8368            (self.1).on_tx_stream_progress(&mut context.1, meta, event);
8369        }
8370        #[inline]
8371        fn on_keep_alive_timer_expired(
8372            &mut self,
8373            context: &mut Self::ConnectionContext,
8374            meta: &api::ConnectionMeta,
8375            event: &api::KeepAliveTimerExpired,
8376        ) {
8377            (self.0).on_keep_alive_timer_expired(&mut context.0, meta, event);
8378            (self.1).on_keep_alive_timer_expired(&mut context.1, meta, event);
8379        }
8380        #[inline]
8381        fn on_mtu_updated(
8382            &mut self,
8383            context: &mut Self::ConnectionContext,
8384            meta: &api::ConnectionMeta,
8385            event: &api::MtuUpdated,
8386        ) {
8387            (self.0).on_mtu_updated(&mut context.0, meta, event);
8388            (self.1).on_mtu_updated(&mut context.1, meta, event);
8389        }
8390        #[inline]
8391        fn on_mtu_probing_complete_received(
8392            &mut self,
8393            context: &mut Self::ConnectionContext,
8394            meta: &api::ConnectionMeta,
8395            event: &api::MtuProbingCompleteReceived,
8396        ) {
8397            (self.0).on_mtu_probing_complete_received(&mut context.0, meta, event);
8398            (self.1).on_mtu_probing_complete_received(&mut context.1, meta, event);
8399        }
8400        #[inline]
8401        fn on_slow_start_exited(
8402            &mut self,
8403            context: &mut Self::ConnectionContext,
8404            meta: &api::ConnectionMeta,
8405            event: &api::SlowStartExited,
8406        ) {
8407            (self.0).on_slow_start_exited(&mut context.0, meta, event);
8408            (self.1).on_slow_start_exited(&mut context.1, meta, event);
8409        }
8410        #[inline]
8411        fn on_delivery_rate_sampled(
8412            &mut self,
8413            context: &mut Self::ConnectionContext,
8414            meta: &api::ConnectionMeta,
8415            event: &api::DeliveryRateSampled,
8416        ) {
8417            (self.0).on_delivery_rate_sampled(&mut context.0, meta, event);
8418            (self.1).on_delivery_rate_sampled(&mut context.1, meta, event);
8419        }
8420        #[inline]
8421        fn on_pacing_rate_updated(
8422            &mut self,
8423            context: &mut Self::ConnectionContext,
8424            meta: &api::ConnectionMeta,
8425            event: &api::PacingRateUpdated,
8426        ) {
8427            (self.0).on_pacing_rate_updated(&mut context.0, meta, event);
8428            (self.1).on_pacing_rate_updated(&mut context.1, meta, event);
8429        }
8430        #[inline]
8431        fn on_bbr_state_changed(
8432            &mut self,
8433            context: &mut Self::ConnectionContext,
8434            meta: &api::ConnectionMeta,
8435            event: &api::BbrStateChanged,
8436        ) {
8437            (self.0).on_bbr_state_changed(&mut context.0, meta, event);
8438            (self.1).on_bbr_state_changed(&mut context.1, meta, event);
8439        }
8440        #[inline]
8441        fn on_dc_state_changed(
8442            &mut self,
8443            context: &mut Self::ConnectionContext,
8444            meta: &api::ConnectionMeta,
8445            event: &api::DcStateChanged,
8446        ) {
8447            (self.0).on_dc_state_changed(&mut context.0, meta, event);
8448            (self.1).on_dc_state_changed(&mut context.1, meta, event);
8449        }
8450        #[inline]
8451        fn on_dc_path_created(
8452            &mut self,
8453            context: &mut Self::ConnectionContext,
8454            meta: &api::ConnectionMeta,
8455            event: &api::DcPathCreated,
8456        ) {
8457            (self.0).on_dc_path_created(&mut context.0, meta, event);
8458            (self.1).on_dc_path_created(&mut context.1, meta, event);
8459        }
8460        #[inline]
8461        fn on_connection_closed(
8462            &mut self,
8463            context: &mut Self::ConnectionContext,
8464            meta: &api::ConnectionMeta,
8465            event: &api::ConnectionClosed,
8466        ) {
8467            (self.0).on_connection_closed(&mut context.0, meta, event);
8468            (self.1).on_connection_closed(&mut context.1, meta, event);
8469        }
8470        #[inline]
8471        fn on_version_information(
8472            &mut self,
8473            meta: &api::EndpointMeta,
8474            event: &api::VersionInformation,
8475        ) {
8476            (self.0).on_version_information(meta, event);
8477            (self.1).on_version_information(meta, event);
8478        }
8479        #[inline]
8480        fn on_endpoint_packet_sent(
8481            &mut self,
8482            meta: &api::EndpointMeta,
8483            event: &api::EndpointPacketSent,
8484        ) {
8485            (self.0).on_endpoint_packet_sent(meta, event);
8486            (self.1).on_endpoint_packet_sent(meta, event);
8487        }
8488        #[inline]
8489        fn on_endpoint_packet_received(
8490            &mut self,
8491            meta: &api::EndpointMeta,
8492            event: &api::EndpointPacketReceived,
8493        ) {
8494            (self.0).on_endpoint_packet_received(meta, event);
8495            (self.1).on_endpoint_packet_received(meta, event);
8496        }
8497        #[inline]
8498        fn on_endpoint_datagram_sent(
8499            &mut self,
8500            meta: &api::EndpointMeta,
8501            event: &api::EndpointDatagramSent,
8502        ) {
8503            (self.0).on_endpoint_datagram_sent(meta, event);
8504            (self.1).on_endpoint_datagram_sent(meta, event);
8505        }
8506        #[inline]
8507        fn on_endpoint_datagram_received(
8508            &mut self,
8509            meta: &api::EndpointMeta,
8510            event: &api::EndpointDatagramReceived,
8511        ) {
8512            (self.0).on_endpoint_datagram_received(meta, event);
8513            (self.1).on_endpoint_datagram_received(meta, event);
8514        }
8515        #[inline]
8516        fn on_endpoint_datagram_dropped(
8517            &mut self,
8518            meta: &api::EndpointMeta,
8519            event: &api::EndpointDatagramDropped,
8520        ) {
8521            (self.0).on_endpoint_datagram_dropped(meta, event);
8522            (self.1).on_endpoint_datagram_dropped(meta, event);
8523        }
8524        #[inline]
8525        fn on_endpoint_connection_attempt_failed(
8526            &mut self,
8527            meta: &api::EndpointMeta,
8528            event: &api::EndpointConnectionAttemptFailed,
8529        ) {
8530            (self.0).on_endpoint_connection_attempt_failed(meta, event);
8531            (self.1).on_endpoint_connection_attempt_failed(meta, event);
8532        }
8533        #[inline]
8534        fn on_endpoint_connection_attempt_deduplicated(
8535            &mut self,
8536            meta: &api::EndpointMeta,
8537            event: &api::EndpointConnectionAttemptDeduplicated,
8538        ) {
8539            (self.0).on_endpoint_connection_attempt_deduplicated(meta, event);
8540            (self.1).on_endpoint_connection_attempt_deduplicated(meta, event);
8541        }
8542        #[inline]
8543        fn on_platform_tx(&mut self, meta: &api::EndpointMeta, event: &api::PlatformTx) {
8544            (self.0).on_platform_tx(meta, event);
8545            (self.1).on_platform_tx(meta, event);
8546        }
8547        #[inline]
8548        fn on_platform_tx_error(&mut self, meta: &api::EndpointMeta, event: &api::PlatformTxError) {
8549            (self.0).on_platform_tx_error(meta, event);
8550            (self.1).on_platform_tx_error(meta, event);
8551        }
8552        #[inline]
8553        fn on_platform_rx(&mut self, meta: &api::EndpointMeta, event: &api::PlatformRx) {
8554            (self.0).on_platform_rx(meta, event);
8555            (self.1).on_platform_rx(meta, event);
8556        }
8557        #[inline]
8558        fn on_platform_rx_error(&mut self, meta: &api::EndpointMeta, event: &api::PlatformRxError) {
8559            (self.0).on_platform_rx_error(meta, event);
8560            (self.1).on_platform_rx_error(meta, event);
8561        }
8562        #[inline]
8563        fn on_platform_feature_configured(
8564            &mut self,
8565            meta: &api::EndpointMeta,
8566            event: &api::PlatformFeatureConfigured,
8567        ) {
8568            (self.0).on_platform_feature_configured(meta, event);
8569            (self.1).on_platform_feature_configured(meta, event);
8570        }
8571        #[inline]
8572        fn on_platform_event_loop_wakeup(
8573            &mut self,
8574            meta: &api::EndpointMeta,
8575            event: &api::PlatformEventLoopWakeup,
8576        ) {
8577            (self.0).on_platform_event_loop_wakeup(meta, event);
8578            (self.1).on_platform_event_loop_wakeup(meta, event);
8579        }
8580        #[inline]
8581        fn on_platform_event_loop_sleep(
8582            &mut self,
8583            meta: &api::EndpointMeta,
8584            event: &api::PlatformEventLoopSleep,
8585        ) {
8586            (self.0).on_platform_event_loop_sleep(meta, event);
8587            (self.1).on_platform_event_loop_sleep(meta, event);
8588        }
8589        #[inline]
8590        fn on_platform_event_loop_started(
8591            &mut self,
8592            meta: &api::EndpointMeta,
8593            event: &api::PlatformEventLoopStarted,
8594        ) {
8595            (self.0).on_platform_event_loop_started(meta, event);
8596            (self.1).on_platform_event_loop_started(meta, event);
8597        }
8598        #[inline]
8599        fn on_event<M: Meta, E: Event>(&mut self, meta: &M, event: &E) {
8600            self.0.on_event(meta, event);
8601            self.1.on_event(meta, event);
8602        }
8603        #[inline]
8604        fn on_connection_event<E: Event>(
8605            &mut self,
8606            context: &mut Self::ConnectionContext,
8607            meta: &api::ConnectionMeta,
8608            event: &E,
8609        ) {
8610            self.0.on_connection_event(&mut context.0, meta, event);
8611            self.1.on_connection_event(&mut context.1, meta, event);
8612        }
8613        #[inline]
8614        fn query(
8615            context: &Self::ConnectionContext,
8616            query: &mut dyn query::Query,
8617        ) -> query::ControlFlow {
8618            query
8619                .execute(context)
8620                .and_then(|| A::query(&context.0, query))
8621                .and_then(|| B::query(&context.1, query))
8622        }
8623        #[inline]
8624        fn query_mut(
8625            context: &mut Self::ConnectionContext,
8626            query: &mut dyn query::QueryMut,
8627        ) -> query::ControlFlow {
8628            query
8629                .execute_mut(context)
8630                .and_then(|| A::query_mut(&mut context.0, query))
8631                .and_then(|| B::query_mut(&mut context.1, query))
8632        }
8633    }
8634    pub trait EndpointPublisher {
8635        #[doc = "Publishes a `VersionInformation` event to the publisher's subscriber"]
8636        fn on_version_information(&mut self, event: builder::VersionInformation);
8637        #[doc = "Publishes a `EndpointPacketSent` event to the publisher's subscriber"]
8638        fn on_endpoint_packet_sent(&mut self, event: builder::EndpointPacketSent);
8639        #[doc = "Publishes a `EndpointPacketReceived` event to the publisher's subscriber"]
8640        fn on_endpoint_packet_received(&mut self, event: builder::EndpointPacketReceived);
8641        #[doc = "Publishes a `EndpointDatagramSent` event to the publisher's subscriber"]
8642        fn on_endpoint_datagram_sent(&mut self, event: builder::EndpointDatagramSent);
8643        #[doc = "Publishes a `EndpointDatagramReceived` event to the publisher's subscriber"]
8644        fn on_endpoint_datagram_received(&mut self, event: builder::EndpointDatagramReceived);
8645        #[doc = "Publishes a `EndpointDatagramDropped` event to the publisher's subscriber"]
8646        fn on_endpoint_datagram_dropped(&mut self, event: builder::EndpointDatagramDropped);
8647        #[doc = "Publishes a `EndpointConnectionAttemptFailed` event to the publisher's subscriber"]
8648        fn on_endpoint_connection_attempt_failed(
8649            &mut self,
8650            event: builder::EndpointConnectionAttemptFailed,
8651        );
8652        #[doc = "Publishes a `EndpointConnectionAttemptDeduplicated` event to the publisher's subscriber"]
8653        fn on_endpoint_connection_attempt_deduplicated(
8654            &mut self,
8655            event: builder::EndpointConnectionAttemptDeduplicated,
8656        );
8657        #[doc = "Publishes a `PlatformTx` event to the publisher's subscriber"]
8658        fn on_platform_tx(&mut self, event: builder::PlatformTx);
8659        #[doc = "Publishes a `PlatformTxError` event to the publisher's subscriber"]
8660        fn on_platform_tx_error(&mut self, event: builder::PlatformTxError);
8661        #[doc = "Publishes a `PlatformRx` event to the publisher's subscriber"]
8662        fn on_platform_rx(&mut self, event: builder::PlatformRx);
8663        #[doc = "Publishes a `PlatformRxError` event to the publisher's subscriber"]
8664        fn on_platform_rx_error(&mut self, event: builder::PlatformRxError);
8665        #[doc = "Publishes a `PlatformFeatureConfigured` event to the publisher's subscriber"]
8666        fn on_platform_feature_configured(&mut self, event: builder::PlatformFeatureConfigured);
8667        #[doc = "Publishes a `PlatformEventLoopWakeup` event to the publisher's subscriber"]
8668        fn on_platform_event_loop_wakeup(&mut self, event: builder::PlatformEventLoopWakeup);
8669        #[doc = "Publishes a `PlatformEventLoopSleep` event to the publisher's subscriber"]
8670        fn on_platform_event_loop_sleep(&mut self, event: builder::PlatformEventLoopSleep);
8671        #[doc = "Publishes a `PlatformEventLoopStarted` event to the publisher's subscriber"]
8672        fn on_platform_event_loop_started(&mut self, event: builder::PlatformEventLoopStarted);
8673        #[doc = r" Returns the QUIC version, if any"]
8674        fn quic_version(&self) -> Option<u32>;
8675    }
8676    pub struct EndpointPublisherSubscriber<'a, Sub: Subscriber> {
8677        meta: api::EndpointMeta,
8678        quic_version: Option<u32>,
8679        subscriber: &'a mut Sub,
8680    }
8681    impl<'a, Sub: Subscriber> fmt::Debug for EndpointPublisherSubscriber<'a, Sub> {
8682        fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
8683            f.debug_struct("ConnectionPublisherSubscriber")
8684                .field("meta", &self.meta)
8685                .field("quic_version", &self.quic_version)
8686                .finish()
8687        }
8688    }
8689    impl<'a, Sub: Subscriber> EndpointPublisherSubscriber<'a, Sub> {
8690        #[inline]
8691        pub fn new(
8692            meta: builder::EndpointMeta,
8693            quic_version: Option<u32>,
8694            subscriber: &'a mut Sub,
8695        ) -> Self {
8696            Self {
8697                meta: meta.into_event(),
8698                quic_version,
8699                subscriber,
8700            }
8701        }
8702    }
8703    impl<'a, Sub: Subscriber> EndpointPublisher for EndpointPublisherSubscriber<'a, Sub> {
8704        #[inline]
8705        fn on_version_information(&mut self, event: builder::VersionInformation) {
8706            let event = event.into_event();
8707            self.subscriber.on_version_information(&self.meta, &event);
8708            self.subscriber.on_event(&self.meta, &event);
8709        }
8710        #[inline]
8711        fn on_endpoint_packet_sent(&mut self, event: builder::EndpointPacketSent) {
8712            let event = event.into_event();
8713            self.subscriber.on_endpoint_packet_sent(&self.meta, &event);
8714            self.subscriber.on_event(&self.meta, &event);
8715        }
8716        #[inline]
8717        fn on_endpoint_packet_received(&mut self, event: builder::EndpointPacketReceived) {
8718            let event = event.into_event();
8719            self.subscriber
8720                .on_endpoint_packet_received(&self.meta, &event);
8721            self.subscriber.on_event(&self.meta, &event);
8722        }
8723        #[inline]
8724        fn on_endpoint_datagram_sent(&mut self, event: builder::EndpointDatagramSent) {
8725            let event = event.into_event();
8726            self.subscriber
8727                .on_endpoint_datagram_sent(&self.meta, &event);
8728            self.subscriber.on_event(&self.meta, &event);
8729        }
8730        #[inline]
8731        fn on_endpoint_datagram_received(&mut self, event: builder::EndpointDatagramReceived) {
8732            let event = event.into_event();
8733            self.subscriber
8734                .on_endpoint_datagram_received(&self.meta, &event);
8735            self.subscriber.on_event(&self.meta, &event);
8736        }
8737        #[inline]
8738        fn on_endpoint_datagram_dropped(&mut self, event: builder::EndpointDatagramDropped) {
8739            let event = event.into_event();
8740            self.subscriber
8741                .on_endpoint_datagram_dropped(&self.meta, &event);
8742            self.subscriber.on_event(&self.meta, &event);
8743        }
8744        #[inline]
8745        fn on_endpoint_connection_attempt_failed(
8746            &mut self,
8747            event: builder::EndpointConnectionAttemptFailed,
8748        ) {
8749            let event = event.into_event();
8750            self.subscriber
8751                .on_endpoint_connection_attempt_failed(&self.meta, &event);
8752            self.subscriber.on_event(&self.meta, &event);
8753        }
8754        #[inline]
8755        fn on_endpoint_connection_attempt_deduplicated(
8756            &mut self,
8757            event: builder::EndpointConnectionAttemptDeduplicated,
8758        ) {
8759            let event = event.into_event();
8760            self.subscriber
8761                .on_endpoint_connection_attempt_deduplicated(&self.meta, &event);
8762            self.subscriber.on_event(&self.meta, &event);
8763        }
8764        #[inline]
8765        fn on_platform_tx(&mut self, event: builder::PlatformTx) {
8766            let event = event.into_event();
8767            self.subscriber.on_platform_tx(&self.meta, &event);
8768            self.subscriber.on_event(&self.meta, &event);
8769        }
8770        #[inline]
8771        fn on_platform_tx_error(&mut self, event: builder::PlatformTxError) {
8772            let event = event.into_event();
8773            self.subscriber.on_platform_tx_error(&self.meta, &event);
8774            self.subscriber.on_event(&self.meta, &event);
8775        }
8776        #[inline]
8777        fn on_platform_rx(&mut self, event: builder::PlatformRx) {
8778            let event = event.into_event();
8779            self.subscriber.on_platform_rx(&self.meta, &event);
8780            self.subscriber.on_event(&self.meta, &event);
8781        }
8782        #[inline]
8783        fn on_platform_rx_error(&mut self, event: builder::PlatformRxError) {
8784            let event = event.into_event();
8785            self.subscriber.on_platform_rx_error(&self.meta, &event);
8786            self.subscriber.on_event(&self.meta, &event);
8787        }
8788        #[inline]
8789        fn on_platform_feature_configured(&mut self, event: builder::PlatformFeatureConfigured) {
8790            let event = event.into_event();
8791            self.subscriber
8792                .on_platform_feature_configured(&self.meta, &event);
8793            self.subscriber.on_event(&self.meta, &event);
8794        }
8795        #[inline]
8796        fn on_platform_event_loop_wakeup(&mut self, event: builder::PlatformEventLoopWakeup) {
8797            let event = event.into_event();
8798            self.subscriber
8799                .on_platform_event_loop_wakeup(&self.meta, &event);
8800            self.subscriber.on_event(&self.meta, &event);
8801        }
8802        #[inline]
8803        fn on_platform_event_loop_sleep(&mut self, event: builder::PlatformEventLoopSleep) {
8804            let event = event.into_event();
8805            self.subscriber
8806                .on_platform_event_loop_sleep(&self.meta, &event);
8807            self.subscriber.on_event(&self.meta, &event);
8808        }
8809        #[inline]
8810        fn on_platform_event_loop_started(&mut self, event: builder::PlatformEventLoopStarted) {
8811            let event = event.into_event();
8812            self.subscriber
8813                .on_platform_event_loop_started(&self.meta, &event);
8814            self.subscriber.on_event(&self.meta, &event);
8815        }
8816        #[inline]
8817        fn quic_version(&self) -> Option<u32> {
8818            self.quic_version
8819        }
8820    }
8821    pub trait ConnectionPublisher {
8822        #[doc = "Publishes a `ApplicationProtocolInformation` event to the publisher's subscriber"]
8823        fn on_application_protocol_information(
8824            &mut self,
8825            event: builder::ApplicationProtocolInformation,
8826        );
8827        #[doc = "Publishes a `ServerNameInformation` event to the publisher's subscriber"]
8828        fn on_server_name_information(&mut self, event: builder::ServerNameInformation);
8829        #[doc = "Publishes a `KeyExchangeGroup` event to the publisher's subscriber"]
8830        fn on_key_exchange_group(&mut self, event: builder::KeyExchangeGroup);
8831        #[doc = "Publishes a `PacketSkipped` event to the publisher's subscriber"]
8832        fn on_packet_skipped(&mut self, event: builder::PacketSkipped);
8833        #[doc = "Publishes a `PacketSent` event to the publisher's subscriber"]
8834        fn on_packet_sent(&mut self, event: builder::PacketSent);
8835        #[doc = "Publishes a `PacketReceived` event to the publisher's subscriber"]
8836        fn on_packet_received(&mut self, event: builder::PacketReceived);
8837        #[doc = "Publishes a `ActivePathUpdated` event to the publisher's subscriber"]
8838        fn on_active_path_updated(&mut self, event: builder::ActivePathUpdated);
8839        #[doc = "Publishes a `PathCreated` event to the publisher's subscriber"]
8840        fn on_path_created(&mut self, event: builder::PathCreated);
8841        #[doc = "Publishes a `FrameSent` event to the publisher's subscriber"]
8842        fn on_frame_sent(&mut self, event: builder::FrameSent);
8843        #[doc = "Publishes a `FrameReceived` event to the publisher's subscriber"]
8844        fn on_frame_received(&mut self, event: builder::FrameReceived);
8845        #[doc = "Publishes a `ConnectionCloseFrameReceived` event to the publisher's subscriber"]
8846        fn on_connection_close_frame_received(
8847            &mut self,
8848            event: builder::ConnectionCloseFrameReceived,
8849        );
8850        #[doc = "Publishes a `PacketLost` event to the publisher's subscriber"]
8851        fn on_packet_lost(&mut self, event: builder::PacketLost);
8852        #[doc = "Publishes a `RecoveryMetrics` event to the publisher's subscriber"]
8853        fn on_recovery_metrics(&mut self, event: builder::RecoveryMetrics);
8854        #[doc = "Publishes a `Congestion` event to the publisher's subscriber"]
8855        fn on_congestion(&mut self, event: builder::Congestion);
8856        #[doc = "Publishes a `AckProcessed` event to the publisher's subscriber"]
8857        fn on_ack_processed(&mut self, event: builder::AckProcessed);
8858        #[doc = "Publishes a `RxAckRangeDropped` event to the publisher's subscriber"]
8859        fn on_rx_ack_range_dropped(&mut self, event: builder::RxAckRangeDropped);
8860        #[doc = "Publishes a `AckRangeReceived` event to the publisher's subscriber"]
8861        fn on_ack_range_received(&mut self, event: builder::AckRangeReceived);
8862        #[doc = "Publishes a `AckRangeSent` event to the publisher's subscriber"]
8863        fn on_ack_range_sent(&mut self, event: builder::AckRangeSent);
8864        #[doc = "Publishes a `PacketDropped` event to the publisher's subscriber"]
8865        fn on_packet_dropped(&mut self, event: builder::PacketDropped);
8866        #[doc = "Publishes a `KeyUpdate` event to the publisher's subscriber"]
8867        fn on_key_update(&mut self, event: builder::KeyUpdate);
8868        #[doc = "Publishes a `KeySpaceDiscarded` event to the publisher's subscriber"]
8869        fn on_key_space_discarded(&mut self, event: builder::KeySpaceDiscarded);
8870        #[doc = "Publishes a `ConnectionStarted` event to the publisher's subscriber"]
8871        fn on_connection_started(&mut self, event: builder::ConnectionStarted);
8872        #[doc = "Publishes a `DuplicatePacket` event to the publisher's subscriber"]
8873        fn on_duplicate_packet(&mut self, event: builder::DuplicatePacket);
8874        #[doc = "Publishes a `TransportParametersReceived` event to the publisher's subscriber"]
8875        fn on_transport_parameters_received(&mut self, event: builder::TransportParametersReceived);
8876        #[doc = "Publishes a `DatagramSent` event to the publisher's subscriber"]
8877        fn on_datagram_sent(&mut self, event: builder::DatagramSent);
8878        #[doc = "Publishes a `DatagramReceived` event to the publisher's subscriber"]
8879        fn on_datagram_received(&mut self, event: builder::DatagramReceived);
8880        #[doc = "Publishes a `DatagramDropped` event to the publisher's subscriber"]
8881        fn on_datagram_dropped(&mut self, event: builder::DatagramDropped);
8882        #[doc = "Publishes a `HandshakeRemoteAddressChangeObserved` event to the publisher's subscriber"]
8883        fn on_handshake_remote_address_change_observed(
8884            &mut self,
8885            event: builder::HandshakeRemoteAddressChangeObserved,
8886        );
8887        #[doc = "Publishes a `ConnectionIdUpdated` event to the publisher's subscriber"]
8888        fn on_connection_id_updated(&mut self, event: builder::ConnectionIdUpdated);
8889        #[doc = "Publishes a `EcnStateChanged` event to the publisher's subscriber"]
8890        fn on_ecn_state_changed(&mut self, event: builder::EcnStateChanged);
8891        #[doc = "Publishes a `ConnectionMigrationDenied` event to the publisher's subscriber"]
8892        fn on_connection_migration_denied(&mut self, event: builder::ConnectionMigrationDenied);
8893        #[doc = "Publishes a `HandshakeStatusUpdated` event to the publisher's subscriber"]
8894        fn on_handshake_status_updated(&mut self, event: builder::HandshakeStatusUpdated);
8895        #[doc = "Publishes a `TlsExporterReady` event to the publisher's subscriber"]
8896        fn on_tls_exporter_ready(&mut self, event: builder::TlsExporterReady);
8897        #[doc = "Publishes a `TlsHandshakeFailed` event to the publisher's subscriber"]
8898        fn on_tls_handshake_failed(&mut self, event: builder::TlsHandshakeFailed);
8899        #[doc = "Publishes a `PathChallengeUpdated` event to the publisher's subscriber"]
8900        fn on_path_challenge_updated(&mut self, event: builder::PathChallengeUpdated);
8901        #[doc = "Publishes a `TlsClientHello` event to the publisher's subscriber"]
8902        fn on_tls_client_hello(&mut self, event: builder::TlsClientHello);
8903        #[doc = "Publishes a `TlsServerHello` event to the publisher's subscriber"]
8904        fn on_tls_server_hello(&mut self, event: builder::TlsServerHello);
8905        #[doc = "Publishes a `RxStreamProgress` event to the publisher's subscriber"]
8906        fn on_rx_stream_progress(&mut self, event: builder::RxStreamProgress);
8907        #[doc = "Publishes a `TxStreamProgress` event to the publisher's subscriber"]
8908        fn on_tx_stream_progress(&mut self, event: builder::TxStreamProgress);
8909        #[doc = "Publishes a `KeepAliveTimerExpired` event to the publisher's subscriber"]
8910        fn on_keep_alive_timer_expired(&mut self, event: builder::KeepAliveTimerExpired);
8911        #[doc = "Publishes a `MtuUpdated` event to the publisher's subscriber"]
8912        fn on_mtu_updated(&mut self, event: builder::MtuUpdated);
8913        #[doc = "Publishes a `MtuProbingCompleteReceived` event to the publisher's subscriber"]
8914        fn on_mtu_probing_complete_received(&mut self, event: builder::MtuProbingCompleteReceived);
8915        #[doc = "Publishes a `SlowStartExited` event to the publisher's subscriber"]
8916        fn on_slow_start_exited(&mut self, event: builder::SlowStartExited);
8917        #[doc = "Publishes a `DeliveryRateSampled` event to the publisher's subscriber"]
8918        fn on_delivery_rate_sampled(&mut self, event: builder::DeliveryRateSampled);
8919        #[doc = "Publishes a `PacingRateUpdated` event to the publisher's subscriber"]
8920        fn on_pacing_rate_updated(&mut self, event: builder::PacingRateUpdated);
8921        #[doc = "Publishes a `BbrStateChanged` event to the publisher's subscriber"]
8922        fn on_bbr_state_changed(&mut self, event: builder::BbrStateChanged);
8923        #[doc = "Publishes a `DcStateChanged` event to the publisher's subscriber"]
8924        fn on_dc_state_changed(&mut self, event: builder::DcStateChanged);
8925        #[doc = "Publishes a `DcPathCreated` event to the publisher's subscriber"]
8926        fn on_dc_path_created(&mut self, event: builder::DcPathCreated);
8927        #[doc = "Publishes a `ConnectionClosed` event to the publisher's subscriber"]
8928        fn on_connection_closed(&mut self, event: builder::ConnectionClosed);
8929        #[doc = r" Returns the QUIC version negotiated for the current connection, if any"]
8930        fn quic_version(&self) -> u32;
8931        #[doc = r" Returns the [`Subject`] for the current publisher"]
8932        fn subject(&self) -> api::Subject;
8933    }
8934    pub struct ConnectionPublisherSubscriber<'a, Sub: Subscriber> {
8935        meta: api::ConnectionMeta,
8936        quic_version: u32,
8937        subscriber: &'a mut Sub,
8938        context: &'a mut Sub::ConnectionContext,
8939    }
8940    impl<'a, Sub: Subscriber> fmt::Debug for ConnectionPublisherSubscriber<'a, Sub> {
8941        fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
8942            f.debug_struct("ConnectionPublisherSubscriber")
8943                .field("meta", &self.meta)
8944                .field("quic_version", &self.quic_version)
8945                .finish()
8946        }
8947    }
8948    impl<'a, Sub: Subscriber> ConnectionPublisherSubscriber<'a, Sub> {
8949        #[inline]
8950        pub fn new(
8951            meta: builder::ConnectionMeta,
8952            quic_version: u32,
8953            subscriber: &'a mut Sub,
8954            context: &'a mut Sub::ConnectionContext,
8955        ) -> Self {
8956            Self {
8957                meta: meta.into_event(),
8958                quic_version,
8959                subscriber,
8960                context,
8961            }
8962        }
8963    }
8964    impl<'a, Sub: Subscriber> ConnectionPublisher for ConnectionPublisherSubscriber<'a, Sub> {
8965        #[inline]
8966        fn on_application_protocol_information(
8967            &mut self,
8968            event: builder::ApplicationProtocolInformation,
8969        ) {
8970            let event = event.into_event();
8971            self.subscriber
8972                .on_application_protocol_information(self.context, &self.meta, &event);
8973            self.subscriber
8974                .on_connection_event(self.context, &self.meta, &event);
8975            self.subscriber.on_event(&self.meta, &event);
8976        }
8977        #[inline]
8978        fn on_server_name_information(&mut self, event: builder::ServerNameInformation) {
8979            let event = event.into_event();
8980            self.subscriber
8981                .on_server_name_information(self.context, &self.meta, &event);
8982            self.subscriber
8983                .on_connection_event(self.context, &self.meta, &event);
8984            self.subscriber.on_event(&self.meta, &event);
8985        }
8986        #[inline]
8987        fn on_key_exchange_group(&mut self, event: builder::KeyExchangeGroup) {
8988            let event = event.into_event();
8989            self.subscriber
8990                .on_key_exchange_group(self.context, &self.meta, &event);
8991            self.subscriber
8992                .on_connection_event(self.context, &self.meta, &event);
8993            self.subscriber.on_event(&self.meta, &event);
8994        }
8995        #[inline]
8996        fn on_packet_skipped(&mut self, event: builder::PacketSkipped) {
8997            let event = event.into_event();
8998            self.subscriber
8999                .on_packet_skipped(self.context, &self.meta, &event);
9000            self.subscriber
9001                .on_connection_event(self.context, &self.meta, &event);
9002            self.subscriber.on_event(&self.meta, &event);
9003        }
9004        #[inline]
9005        fn on_packet_sent(&mut self, event: builder::PacketSent) {
9006            let event = event.into_event();
9007            self.subscriber
9008                .on_packet_sent(self.context, &self.meta, &event);
9009            self.subscriber
9010                .on_connection_event(self.context, &self.meta, &event);
9011            self.subscriber.on_event(&self.meta, &event);
9012        }
9013        #[inline]
9014        fn on_packet_received(&mut self, event: builder::PacketReceived) {
9015            let event = event.into_event();
9016            self.subscriber
9017                .on_packet_received(self.context, &self.meta, &event);
9018            self.subscriber
9019                .on_connection_event(self.context, &self.meta, &event);
9020            self.subscriber.on_event(&self.meta, &event);
9021        }
9022        #[inline]
9023        fn on_active_path_updated(&mut self, event: builder::ActivePathUpdated) {
9024            let event = event.into_event();
9025            self.subscriber
9026                .on_active_path_updated(self.context, &self.meta, &event);
9027            self.subscriber
9028                .on_connection_event(self.context, &self.meta, &event);
9029            self.subscriber.on_event(&self.meta, &event);
9030        }
9031        #[inline]
9032        fn on_path_created(&mut self, event: builder::PathCreated) {
9033            let event = event.into_event();
9034            self.subscriber
9035                .on_path_created(self.context, &self.meta, &event);
9036            self.subscriber
9037                .on_connection_event(self.context, &self.meta, &event);
9038            self.subscriber.on_event(&self.meta, &event);
9039        }
9040        #[inline]
9041        fn on_frame_sent(&mut self, event: builder::FrameSent) {
9042            let event = event.into_event();
9043            self.subscriber
9044                .on_frame_sent(self.context, &self.meta, &event);
9045            self.subscriber
9046                .on_connection_event(self.context, &self.meta, &event);
9047            self.subscriber.on_event(&self.meta, &event);
9048        }
9049        #[inline]
9050        fn on_frame_received(&mut self, event: builder::FrameReceived) {
9051            let event = event.into_event();
9052            self.subscriber
9053                .on_frame_received(self.context, &self.meta, &event);
9054            self.subscriber
9055                .on_connection_event(self.context, &self.meta, &event);
9056            self.subscriber.on_event(&self.meta, &event);
9057        }
9058        #[inline]
9059        fn on_connection_close_frame_received(
9060            &mut self,
9061            event: builder::ConnectionCloseFrameReceived,
9062        ) {
9063            let event = event.into_event();
9064            self.subscriber
9065                .on_connection_close_frame_received(self.context, &self.meta, &event);
9066            self.subscriber
9067                .on_connection_event(self.context, &self.meta, &event);
9068            self.subscriber.on_event(&self.meta, &event);
9069        }
9070        #[inline]
9071        fn on_packet_lost(&mut self, event: builder::PacketLost) {
9072            let event = event.into_event();
9073            self.subscriber
9074                .on_packet_lost(self.context, &self.meta, &event);
9075            self.subscriber
9076                .on_connection_event(self.context, &self.meta, &event);
9077            self.subscriber.on_event(&self.meta, &event);
9078        }
9079        #[inline]
9080        fn on_recovery_metrics(&mut self, event: builder::RecoveryMetrics) {
9081            let event = event.into_event();
9082            self.subscriber
9083                .on_recovery_metrics(self.context, &self.meta, &event);
9084            self.subscriber
9085                .on_connection_event(self.context, &self.meta, &event);
9086            self.subscriber.on_event(&self.meta, &event);
9087        }
9088        #[inline]
9089        fn on_congestion(&mut self, event: builder::Congestion) {
9090            let event = event.into_event();
9091            self.subscriber
9092                .on_congestion(self.context, &self.meta, &event);
9093            self.subscriber
9094                .on_connection_event(self.context, &self.meta, &event);
9095            self.subscriber.on_event(&self.meta, &event);
9096        }
9097        #[inline]
9098        #[allow(deprecated)]
9099        fn on_ack_processed(&mut self, event: builder::AckProcessed) {
9100            let event = event.into_event();
9101            self.subscriber
9102                .on_ack_processed(self.context, &self.meta, &event);
9103            self.subscriber
9104                .on_connection_event(self.context, &self.meta, &event);
9105            self.subscriber.on_event(&self.meta, &event);
9106        }
9107        #[inline]
9108        fn on_rx_ack_range_dropped(&mut self, event: builder::RxAckRangeDropped) {
9109            let event = event.into_event();
9110            self.subscriber
9111                .on_rx_ack_range_dropped(self.context, &self.meta, &event);
9112            self.subscriber
9113                .on_connection_event(self.context, &self.meta, &event);
9114            self.subscriber.on_event(&self.meta, &event);
9115        }
9116        #[inline]
9117        fn on_ack_range_received(&mut self, event: builder::AckRangeReceived) {
9118            let event = event.into_event();
9119            self.subscriber
9120                .on_ack_range_received(self.context, &self.meta, &event);
9121            self.subscriber
9122                .on_connection_event(self.context, &self.meta, &event);
9123            self.subscriber.on_event(&self.meta, &event);
9124        }
9125        #[inline]
9126        fn on_ack_range_sent(&mut self, event: builder::AckRangeSent) {
9127            let event = event.into_event();
9128            self.subscriber
9129                .on_ack_range_sent(self.context, &self.meta, &event);
9130            self.subscriber
9131                .on_connection_event(self.context, &self.meta, &event);
9132            self.subscriber.on_event(&self.meta, &event);
9133        }
9134        #[inline]
9135        fn on_packet_dropped(&mut self, event: builder::PacketDropped) {
9136            let event = event.into_event();
9137            self.subscriber
9138                .on_packet_dropped(self.context, &self.meta, &event);
9139            self.subscriber
9140                .on_connection_event(self.context, &self.meta, &event);
9141            self.subscriber.on_event(&self.meta, &event);
9142        }
9143        #[inline]
9144        fn on_key_update(&mut self, event: builder::KeyUpdate) {
9145            let event = event.into_event();
9146            self.subscriber
9147                .on_key_update(self.context, &self.meta, &event);
9148            self.subscriber
9149                .on_connection_event(self.context, &self.meta, &event);
9150            self.subscriber.on_event(&self.meta, &event);
9151        }
9152        #[inline]
9153        fn on_key_space_discarded(&mut self, event: builder::KeySpaceDiscarded) {
9154            let event = event.into_event();
9155            self.subscriber
9156                .on_key_space_discarded(self.context, &self.meta, &event);
9157            self.subscriber
9158                .on_connection_event(self.context, &self.meta, &event);
9159            self.subscriber.on_event(&self.meta, &event);
9160        }
9161        #[inline]
9162        fn on_connection_started(&mut self, event: builder::ConnectionStarted) {
9163            let event = event.into_event();
9164            self.subscriber
9165                .on_connection_started(self.context, &self.meta, &event);
9166            self.subscriber
9167                .on_connection_event(self.context, &self.meta, &event);
9168            self.subscriber.on_event(&self.meta, &event);
9169        }
9170        #[inline]
9171        fn on_duplicate_packet(&mut self, event: builder::DuplicatePacket) {
9172            let event = event.into_event();
9173            self.subscriber
9174                .on_duplicate_packet(self.context, &self.meta, &event);
9175            self.subscriber
9176                .on_connection_event(self.context, &self.meta, &event);
9177            self.subscriber.on_event(&self.meta, &event);
9178        }
9179        #[inline]
9180        fn on_transport_parameters_received(
9181            &mut self,
9182            event: builder::TransportParametersReceived,
9183        ) {
9184            let event = event.into_event();
9185            self.subscriber
9186                .on_transport_parameters_received(self.context, &self.meta, &event);
9187            self.subscriber
9188                .on_connection_event(self.context, &self.meta, &event);
9189            self.subscriber.on_event(&self.meta, &event);
9190        }
9191        #[inline]
9192        fn on_datagram_sent(&mut self, event: builder::DatagramSent) {
9193            let event = event.into_event();
9194            self.subscriber
9195                .on_datagram_sent(self.context, &self.meta, &event);
9196            self.subscriber
9197                .on_connection_event(self.context, &self.meta, &event);
9198            self.subscriber.on_event(&self.meta, &event);
9199        }
9200        #[inline]
9201        fn on_datagram_received(&mut self, event: builder::DatagramReceived) {
9202            let event = event.into_event();
9203            self.subscriber
9204                .on_datagram_received(self.context, &self.meta, &event);
9205            self.subscriber
9206                .on_connection_event(self.context, &self.meta, &event);
9207            self.subscriber.on_event(&self.meta, &event);
9208        }
9209        #[inline]
9210        fn on_datagram_dropped(&mut self, event: builder::DatagramDropped) {
9211            let event = event.into_event();
9212            self.subscriber
9213                .on_datagram_dropped(self.context, &self.meta, &event);
9214            self.subscriber
9215                .on_connection_event(self.context, &self.meta, &event);
9216            self.subscriber.on_event(&self.meta, &event);
9217        }
9218        #[inline]
9219        fn on_handshake_remote_address_change_observed(
9220            &mut self,
9221            event: builder::HandshakeRemoteAddressChangeObserved,
9222        ) {
9223            let event = event.into_event();
9224            self.subscriber.on_handshake_remote_address_change_observed(
9225                self.context,
9226                &self.meta,
9227                &event,
9228            );
9229            self.subscriber
9230                .on_connection_event(self.context, &self.meta, &event);
9231            self.subscriber.on_event(&self.meta, &event);
9232        }
9233        #[inline]
9234        fn on_connection_id_updated(&mut self, event: builder::ConnectionIdUpdated) {
9235            let event = event.into_event();
9236            self.subscriber
9237                .on_connection_id_updated(self.context, &self.meta, &event);
9238            self.subscriber
9239                .on_connection_event(self.context, &self.meta, &event);
9240            self.subscriber.on_event(&self.meta, &event);
9241        }
9242        #[inline]
9243        fn on_ecn_state_changed(&mut self, event: builder::EcnStateChanged) {
9244            let event = event.into_event();
9245            self.subscriber
9246                .on_ecn_state_changed(self.context, &self.meta, &event);
9247            self.subscriber
9248                .on_connection_event(self.context, &self.meta, &event);
9249            self.subscriber.on_event(&self.meta, &event);
9250        }
9251        #[inline]
9252        fn on_connection_migration_denied(&mut self, event: builder::ConnectionMigrationDenied) {
9253            let event = event.into_event();
9254            self.subscriber
9255                .on_connection_migration_denied(self.context, &self.meta, &event);
9256            self.subscriber
9257                .on_connection_event(self.context, &self.meta, &event);
9258            self.subscriber.on_event(&self.meta, &event);
9259        }
9260        #[inline]
9261        fn on_handshake_status_updated(&mut self, event: builder::HandshakeStatusUpdated) {
9262            let event = event.into_event();
9263            self.subscriber
9264                .on_handshake_status_updated(self.context, &self.meta, &event);
9265            self.subscriber
9266                .on_connection_event(self.context, &self.meta, &event);
9267            self.subscriber.on_event(&self.meta, &event);
9268        }
9269        #[inline]
9270        fn on_tls_exporter_ready(&mut self, event: builder::TlsExporterReady) {
9271            let event = event.into_event();
9272            self.subscriber
9273                .on_tls_exporter_ready(self.context, &self.meta, &event);
9274            self.subscriber
9275                .on_connection_event(self.context, &self.meta, &event);
9276            self.subscriber.on_event(&self.meta, &event);
9277        }
9278        #[inline]
9279        fn on_tls_handshake_failed(&mut self, event: builder::TlsHandshakeFailed) {
9280            let event = event.into_event();
9281            self.subscriber
9282                .on_tls_handshake_failed(self.context, &self.meta, &event);
9283            self.subscriber
9284                .on_connection_event(self.context, &self.meta, &event);
9285            self.subscriber.on_event(&self.meta, &event);
9286        }
9287        #[inline]
9288        fn on_path_challenge_updated(&mut self, event: builder::PathChallengeUpdated) {
9289            let event = event.into_event();
9290            self.subscriber
9291                .on_path_challenge_updated(self.context, &self.meta, &event);
9292            self.subscriber
9293                .on_connection_event(self.context, &self.meta, &event);
9294            self.subscriber.on_event(&self.meta, &event);
9295        }
9296        #[inline]
9297        fn on_tls_client_hello(&mut self, event: builder::TlsClientHello) {
9298            let event = event.into_event();
9299            self.subscriber
9300                .on_tls_client_hello(self.context, &self.meta, &event);
9301            self.subscriber
9302                .on_connection_event(self.context, &self.meta, &event);
9303            self.subscriber.on_event(&self.meta, &event);
9304        }
9305        #[inline]
9306        fn on_tls_server_hello(&mut self, event: builder::TlsServerHello) {
9307            let event = event.into_event();
9308            self.subscriber
9309                .on_tls_server_hello(self.context, &self.meta, &event);
9310            self.subscriber
9311                .on_connection_event(self.context, &self.meta, &event);
9312            self.subscriber.on_event(&self.meta, &event);
9313        }
9314        #[inline]
9315        fn on_rx_stream_progress(&mut self, event: builder::RxStreamProgress) {
9316            let event = event.into_event();
9317            self.subscriber
9318                .on_rx_stream_progress(self.context, &self.meta, &event);
9319            self.subscriber
9320                .on_connection_event(self.context, &self.meta, &event);
9321            self.subscriber.on_event(&self.meta, &event);
9322        }
9323        #[inline]
9324        fn on_tx_stream_progress(&mut self, event: builder::TxStreamProgress) {
9325            let event = event.into_event();
9326            self.subscriber
9327                .on_tx_stream_progress(self.context, &self.meta, &event);
9328            self.subscriber
9329                .on_connection_event(self.context, &self.meta, &event);
9330            self.subscriber.on_event(&self.meta, &event);
9331        }
9332        #[inline]
9333        fn on_keep_alive_timer_expired(&mut self, event: builder::KeepAliveTimerExpired) {
9334            let event = event.into_event();
9335            self.subscriber
9336                .on_keep_alive_timer_expired(self.context, &self.meta, &event);
9337            self.subscriber
9338                .on_connection_event(self.context, &self.meta, &event);
9339            self.subscriber.on_event(&self.meta, &event);
9340        }
9341        #[inline]
9342        fn on_mtu_updated(&mut self, event: builder::MtuUpdated) {
9343            let event = event.into_event();
9344            self.subscriber
9345                .on_mtu_updated(self.context, &self.meta, &event);
9346            self.subscriber
9347                .on_connection_event(self.context, &self.meta, &event);
9348            self.subscriber.on_event(&self.meta, &event);
9349        }
9350        #[inline]
9351        fn on_mtu_probing_complete_received(&mut self, event: builder::MtuProbingCompleteReceived) {
9352            let event = event.into_event();
9353            self.subscriber
9354                .on_mtu_probing_complete_received(self.context, &self.meta, &event);
9355            self.subscriber
9356                .on_connection_event(self.context, &self.meta, &event);
9357            self.subscriber.on_event(&self.meta, &event);
9358        }
9359        #[inline]
9360        fn on_slow_start_exited(&mut self, event: builder::SlowStartExited) {
9361            let event = event.into_event();
9362            self.subscriber
9363                .on_slow_start_exited(self.context, &self.meta, &event);
9364            self.subscriber
9365                .on_connection_event(self.context, &self.meta, &event);
9366            self.subscriber.on_event(&self.meta, &event);
9367        }
9368        #[inline]
9369        fn on_delivery_rate_sampled(&mut self, event: builder::DeliveryRateSampled) {
9370            let event = event.into_event();
9371            self.subscriber
9372                .on_delivery_rate_sampled(self.context, &self.meta, &event);
9373            self.subscriber
9374                .on_connection_event(self.context, &self.meta, &event);
9375            self.subscriber.on_event(&self.meta, &event);
9376        }
9377        #[inline]
9378        fn on_pacing_rate_updated(&mut self, event: builder::PacingRateUpdated) {
9379            let event = event.into_event();
9380            self.subscriber
9381                .on_pacing_rate_updated(self.context, &self.meta, &event);
9382            self.subscriber
9383                .on_connection_event(self.context, &self.meta, &event);
9384            self.subscriber.on_event(&self.meta, &event);
9385        }
9386        #[inline]
9387        fn on_bbr_state_changed(&mut self, event: builder::BbrStateChanged) {
9388            let event = event.into_event();
9389            self.subscriber
9390                .on_bbr_state_changed(self.context, &self.meta, &event);
9391            self.subscriber
9392                .on_connection_event(self.context, &self.meta, &event);
9393            self.subscriber.on_event(&self.meta, &event);
9394        }
9395        #[inline]
9396        fn on_dc_state_changed(&mut self, event: builder::DcStateChanged) {
9397            let event = event.into_event();
9398            self.subscriber
9399                .on_dc_state_changed(self.context, &self.meta, &event);
9400            self.subscriber
9401                .on_connection_event(self.context, &self.meta, &event);
9402            self.subscriber.on_event(&self.meta, &event);
9403        }
9404        #[inline]
9405        fn on_dc_path_created(&mut self, event: builder::DcPathCreated) {
9406            let event = event.into_event();
9407            self.subscriber
9408                .on_dc_path_created(self.context, &self.meta, &event);
9409            self.subscriber
9410                .on_connection_event(self.context, &self.meta, &event);
9411            self.subscriber.on_event(&self.meta, &event);
9412        }
9413        #[inline]
9414        fn on_connection_closed(&mut self, event: builder::ConnectionClosed) {
9415            let event = event.into_event();
9416            self.subscriber
9417                .on_connection_closed(self.context, &self.meta, &event);
9418            self.subscriber
9419                .on_connection_event(self.context, &self.meta, &event);
9420            self.subscriber.on_event(&self.meta, &event);
9421        }
9422        #[inline]
9423        fn quic_version(&self) -> u32 {
9424            self.quic_version
9425        }
9426        #[inline]
9427        fn subject(&self) -> api::Subject {
9428            self.meta.subject()
9429        }
9430    }
9431}
9432#[cfg(any(test, feature = "testing"))]
9433pub mod testing {
9434    use super::*;
9435    use crate::event::snapshot::Location;
9436    pub mod endpoint {
9437        use super::*;
9438        pub struct Subscriber {
9439            location: Option<Location>,
9440            output: Vec<String>,
9441            pub version_information: u64,
9442            pub endpoint_packet_sent: u64,
9443            pub endpoint_packet_received: u64,
9444            pub endpoint_datagram_sent: u64,
9445            pub endpoint_datagram_received: u64,
9446            pub endpoint_datagram_dropped: u64,
9447            pub endpoint_connection_attempt_failed: u64,
9448            pub endpoint_connection_attempt_deduplicated: u64,
9449            pub platform_tx: u64,
9450            pub platform_tx_error: u64,
9451            pub platform_rx: u64,
9452            pub platform_rx_error: u64,
9453            pub platform_feature_configured: u64,
9454            pub platform_event_loop_wakeup: u64,
9455            pub platform_event_loop_sleep: u64,
9456            pub platform_event_loop_started: u64,
9457        }
9458        impl Drop for Subscriber {
9459            fn drop(&mut self) {
9460                if std::thread::panicking() {
9461                    return;
9462                }
9463                if let Some(location) = self.location.as_ref() {
9464                    location.snapshot_log(&self.output);
9465                }
9466            }
9467        }
9468        impl Subscriber {
9469            #[doc = r" Creates a subscriber with snapshot assertions enabled"]
9470            #[track_caller]
9471            pub fn snapshot() -> Self {
9472                let mut sub = Self::no_snapshot();
9473                sub.location = Location::from_thread_name();
9474                sub
9475            }
9476            #[doc = r" Creates a subscriber with snapshot assertions enabled"]
9477            #[track_caller]
9478            pub fn named_snapshot<Name: core::fmt::Display>(name: Name) -> Self {
9479                let mut sub = Self::no_snapshot();
9480                sub.location = Some(Location::new(name));
9481                sub
9482            }
9483            #[doc = r" Creates a subscriber with snapshot assertions disabled"]
9484            pub fn no_snapshot() -> Self {
9485                Self {
9486                    location: None,
9487                    output: Default::default(),
9488                    version_information: 0,
9489                    endpoint_packet_sent: 0,
9490                    endpoint_packet_received: 0,
9491                    endpoint_datagram_sent: 0,
9492                    endpoint_datagram_received: 0,
9493                    endpoint_datagram_dropped: 0,
9494                    endpoint_connection_attempt_failed: 0,
9495                    endpoint_connection_attempt_deduplicated: 0,
9496                    platform_tx: 0,
9497                    platform_tx_error: 0,
9498                    platform_rx: 0,
9499                    platform_rx_error: 0,
9500                    platform_feature_configured: 0,
9501                    platform_event_loop_wakeup: 0,
9502                    platform_event_loop_sleep: 0,
9503                    platform_event_loop_started: 0,
9504                }
9505            }
9506        }
9507        impl super::super::Subscriber for Subscriber {
9508            type ConnectionContext = ();
9509            fn create_connection_context(
9510                &mut self,
9511                _meta: &api::ConnectionMeta,
9512                _info: &api::ConnectionInfo,
9513            ) -> Self::ConnectionContext {
9514            }
9515            fn on_version_information(
9516                &mut self,
9517                meta: &api::EndpointMeta,
9518                event: &api::VersionInformation,
9519            ) {
9520                self.version_information += 1;
9521                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
9522                let event = crate::event::snapshot::Fmt::to_snapshot(event);
9523                let out = format!("{meta:?} {event:?}");
9524                self.output.push(out);
9525            }
9526            fn on_endpoint_packet_sent(
9527                &mut self,
9528                meta: &api::EndpointMeta,
9529                event: &api::EndpointPacketSent,
9530            ) {
9531                self.endpoint_packet_sent += 1;
9532                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
9533                let event = crate::event::snapshot::Fmt::to_snapshot(event);
9534                let out = format!("{meta:?} {event:?}");
9535                self.output.push(out);
9536            }
9537            fn on_endpoint_packet_received(
9538                &mut self,
9539                meta: &api::EndpointMeta,
9540                event: &api::EndpointPacketReceived,
9541            ) {
9542                self.endpoint_packet_received += 1;
9543                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
9544                let event = crate::event::snapshot::Fmt::to_snapshot(event);
9545                let out = format!("{meta:?} {event:?}");
9546                self.output.push(out);
9547            }
9548            fn on_endpoint_datagram_sent(
9549                &mut self,
9550                meta: &api::EndpointMeta,
9551                event: &api::EndpointDatagramSent,
9552            ) {
9553                self.endpoint_datagram_sent += 1;
9554                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
9555                let event = crate::event::snapshot::Fmt::to_snapshot(event);
9556                let out = format!("{meta:?} {event:?}");
9557                self.output.push(out);
9558            }
9559            fn on_endpoint_datagram_received(
9560                &mut self,
9561                meta: &api::EndpointMeta,
9562                event: &api::EndpointDatagramReceived,
9563            ) {
9564                self.endpoint_datagram_received += 1;
9565                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
9566                let event = crate::event::snapshot::Fmt::to_snapshot(event);
9567                let out = format!("{meta:?} {event:?}");
9568                self.output.push(out);
9569            }
9570            fn on_endpoint_datagram_dropped(
9571                &mut self,
9572                meta: &api::EndpointMeta,
9573                event: &api::EndpointDatagramDropped,
9574            ) {
9575                self.endpoint_datagram_dropped += 1;
9576                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
9577                let event = crate::event::snapshot::Fmt::to_snapshot(event);
9578                let out = format!("{meta:?} {event:?}");
9579                self.output.push(out);
9580            }
9581            fn on_endpoint_connection_attempt_failed(
9582                &mut self,
9583                meta: &api::EndpointMeta,
9584                event: &api::EndpointConnectionAttemptFailed,
9585            ) {
9586                self.endpoint_connection_attempt_failed += 1;
9587                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
9588                let event = crate::event::snapshot::Fmt::to_snapshot(event);
9589                let out = format!("{meta:?} {event:?}");
9590                self.output.push(out);
9591            }
9592            fn on_endpoint_connection_attempt_deduplicated(
9593                &mut self,
9594                meta: &api::EndpointMeta,
9595                event: &api::EndpointConnectionAttemptDeduplicated,
9596            ) {
9597                self.endpoint_connection_attempt_deduplicated += 1;
9598                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
9599                let event = crate::event::snapshot::Fmt::to_snapshot(event);
9600                let out = format!("{meta:?} {event:?}");
9601                self.output.push(out);
9602            }
9603            fn on_platform_tx(&mut self, meta: &api::EndpointMeta, event: &api::PlatformTx) {
9604                self.platform_tx += 1;
9605                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
9606                let event = crate::event::snapshot::Fmt::to_snapshot(event);
9607                let out = format!("{meta:?} {event:?}");
9608                self.output.push(out);
9609            }
9610            fn on_platform_tx_error(
9611                &mut self,
9612                meta: &api::EndpointMeta,
9613                event: &api::PlatformTxError,
9614            ) {
9615                self.platform_tx_error += 1;
9616                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
9617                let event = crate::event::snapshot::Fmt::to_snapshot(event);
9618                let out = format!("{meta:?} {event:?}");
9619                self.output.push(out);
9620            }
9621            fn on_platform_rx(&mut self, meta: &api::EndpointMeta, event: &api::PlatformRx) {
9622                self.platform_rx += 1;
9623                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
9624                let event = crate::event::snapshot::Fmt::to_snapshot(event);
9625                let out = format!("{meta:?} {event:?}");
9626                self.output.push(out);
9627            }
9628            fn on_platform_rx_error(
9629                &mut self,
9630                meta: &api::EndpointMeta,
9631                event: &api::PlatformRxError,
9632            ) {
9633                self.platform_rx_error += 1;
9634                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
9635                let event = crate::event::snapshot::Fmt::to_snapshot(event);
9636                let out = format!("{meta:?} {event:?}");
9637                self.output.push(out);
9638            }
9639            fn on_platform_feature_configured(
9640                &mut self,
9641                meta: &api::EndpointMeta,
9642                event: &api::PlatformFeatureConfigured,
9643            ) {
9644                self.platform_feature_configured += 1;
9645                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
9646                let event = crate::event::snapshot::Fmt::to_snapshot(event);
9647                let out = format!("{meta:?} {event:?}");
9648                self.output.push(out);
9649            }
9650            fn on_platform_event_loop_wakeup(
9651                &mut self,
9652                meta: &api::EndpointMeta,
9653                event: &api::PlatformEventLoopWakeup,
9654            ) {
9655                self.platform_event_loop_wakeup += 1;
9656                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
9657                let event = crate::event::snapshot::Fmt::to_snapshot(event);
9658                let out = format!("{meta:?} {event:?}");
9659                self.output.push(out);
9660            }
9661            fn on_platform_event_loop_sleep(
9662                &mut self,
9663                meta: &api::EndpointMeta,
9664                event: &api::PlatformEventLoopSleep,
9665            ) {
9666                self.platform_event_loop_sleep += 1;
9667                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
9668                let event = crate::event::snapshot::Fmt::to_snapshot(event);
9669                let out = format!("{meta:?} {event:?}");
9670                self.output.push(out);
9671            }
9672            fn on_platform_event_loop_started(
9673                &mut self,
9674                meta: &api::EndpointMeta,
9675                event: &api::PlatformEventLoopStarted,
9676            ) {
9677                self.platform_event_loop_started += 1;
9678                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
9679                let event = crate::event::snapshot::Fmt::to_snapshot(event);
9680                let out = format!("{meta:?} {event:?}");
9681                self.output.push(out);
9682            }
9683        }
9684    }
9685    #[derive(Debug)]
9686    pub struct Subscriber {
9687        location: Option<Location>,
9688        output: Vec<String>,
9689        pub application_protocol_information: u64,
9690        pub server_name_information: u64,
9691        pub key_exchange_group: u64,
9692        pub packet_skipped: u64,
9693        pub packet_sent: u64,
9694        pub packet_received: u64,
9695        pub active_path_updated: u64,
9696        pub path_created: u64,
9697        pub frame_sent: u64,
9698        pub frame_received: u64,
9699        pub connection_close_frame_received: u64,
9700        pub packet_lost: u64,
9701        pub recovery_metrics: u64,
9702        pub congestion: u64,
9703        pub ack_processed: u64,
9704        pub rx_ack_range_dropped: u64,
9705        pub ack_range_received: u64,
9706        pub ack_range_sent: u64,
9707        pub packet_dropped: u64,
9708        pub key_update: u64,
9709        pub key_space_discarded: u64,
9710        pub connection_started: u64,
9711        pub duplicate_packet: u64,
9712        pub transport_parameters_received: u64,
9713        pub datagram_sent: u64,
9714        pub datagram_received: u64,
9715        pub datagram_dropped: u64,
9716        pub handshake_remote_address_change_observed: u64,
9717        pub connection_id_updated: u64,
9718        pub ecn_state_changed: u64,
9719        pub connection_migration_denied: u64,
9720        pub handshake_status_updated: u64,
9721        pub tls_exporter_ready: u64,
9722        pub tls_handshake_failed: u64,
9723        pub path_challenge_updated: u64,
9724        pub tls_client_hello: u64,
9725        pub tls_server_hello: u64,
9726        pub rx_stream_progress: u64,
9727        pub tx_stream_progress: u64,
9728        pub keep_alive_timer_expired: u64,
9729        pub mtu_updated: u64,
9730        pub mtu_probing_complete_received: u64,
9731        pub slow_start_exited: u64,
9732        pub delivery_rate_sampled: u64,
9733        pub pacing_rate_updated: u64,
9734        pub bbr_state_changed: u64,
9735        pub dc_state_changed: u64,
9736        pub dc_path_created: u64,
9737        pub connection_closed: u64,
9738        pub version_information: u64,
9739        pub endpoint_packet_sent: u64,
9740        pub endpoint_packet_received: u64,
9741        pub endpoint_datagram_sent: u64,
9742        pub endpoint_datagram_received: u64,
9743        pub endpoint_datagram_dropped: u64,
9744        pub endpoint_connection_attempt_failed: u64,
9745        pub endpoint_connection_attempt_deduplicated: u64,
9746        pub platform_tx: u64,
9747        pub platform_tx_error: u64,
9748        pub platform_rx: u64,
9749        pub platform_rx_error: u64,
9750        pub platform_feature_configured: u64,
9751        pub platform_event_loop_wakeup: u64,
9752        pub platform_event_loop_sleep: u64,
9753        pub platform_event_loop_started: u64,
9754    }
9755    impl Drop for Subscriber {
9756        fn drop(&mut self) {
9757            if std::thread::panicking() {
9758                return;
9759            }
9760            if let Some(location) = self.location.as_ref() {
9761                location.snapshot_log(&self.output);
9762            }
9763        }
9764    }
9765    impl Subscriber {
9766        #[doc = r" Creates a subscriber with snapshot assertions enabled"]
9767        #[track_caller]
9768        pub fn snapshot() -> Self {
9769            let mut sub = Self::no_snapshot();
9770            sub.location = Location::from_thread_name();
9771            sub
9772        }
9773        #[doc = r" Creates a subscriber with snapshot assertions enabled"]
9774        #[track_caller]
9775        pub fn named_snapshot<Name: core::fmt::Display>(name: Name) -> Self {
9776            let mut sub = Self::no_snapshot();
9777            sub.location = Some(Location::new(name));
9778            sub
9779        }
9780        #[doc = r" Creates a subscriber with snapshot assertions disabled"]
9781        pub fn no_snapshot() -> Self {
9782            Self {
9783                location: None,
9784                output: Default::default(),
9785                application_protocol_information: 0,
9786                server_name_information: 0,
9787                key_exchange_group: 0,
9788                packet_skipped: 0,
9789                packet_sent: 0,
9790                packet_received: 0,
9791                active_path_updated: 0,
9792                path_created: 0,
9793                frame_sent: 0,
9794                frame_received: 0,
9795                connection_close_frame_received: 0,
9796                packet_lost: 0,
9797                recovery_metrics: 0,
9798                congestion: 0,
9799                ack_processed: 0,
9800                rx_ack_range_dropped: 0,
9801                ack_range_received: 0,
9802                ack_range_sent: 0,
9803                packet_dropped: 0,
9804                key_update: 0,
9805                key_space_discarded: 0,
9806                connection_started: 0,
9807                duplicate_packet: 0,
9808                transport_parameters_received: 0,
9809                datagram_sent: 0,
9810                datagram_received: 0,
9811                datagram_dropped: 0,
9812                handshake_remote_address_change_observed: 0,
9813                connection_id_updated: 0,
9814                ecn_state_changed: 0,
9815                connection_migration_denied: 0,
9816                handshake_status_updated: 0,
9817                tls_exporter_ready: 0,
9818                tls_handshake_failed: 0,
9819                path_challenge_updated: 0,
9820                tls_client_hello: 0,
9821                tls_server_hello: 0,
9822                rx_stream_progress: 0,
9823                tx_stream_progress: 0,
9824                keep_alive_timer_expired: 0,
9825                mtu_updated: 0,
9826                mtu_probing_complete_received: 0,
9827                slow_start_exited: 0,
9828                delivery_rate_sampled: 0,
9829                pacing_rate_updated: 0,
9830                bbr_state_changed: 0,
9831                dc_state_changed: 0,
9832                dc_path_created: 0,
9833                connection_closed: 0,
9834                version_information: 0,
9835                endpoint_packet_sent: 0,
9836                endpoint_packet_received: 0,
9837                endpoint_datagram_sent: 0,
9838                endpoint_datagram_received: 0,
9839                endpoint_datagram_dropped: 0,
9840                endpoint_connection_attempt_failed: 0,
9841                endpoint_connection_attempt_deduplicated: 0,
9842                platform_tx: 0,
9843                platform_tx_error: 0,
9844                platform_rx: 0,
9845                platform_rx_error: 0,
9846                platform_feature_configured: 0,
9847                platform_event_loop_wakeup: 0,
9848                platform_event_loop_sleep: 0,
9849                platform_event_loop_started: 0,
9850            }
9851        }
9852    }
9853    impl super::Subscriber for Subscriber {
9854        type ConnectionContext = ();
9855        fn create_connection_context(
9856            &mut self,
9857            _meta: &api::ConnectionMeta,
9858            _info: &api::ConnectionInfo,
9859        ) -> Self::ConnectionContext {
9860        }
9861        fn on_application_protocol_information(
9862            &mut self,
9863            _context: &mut Self::ConnectionContext,
9864            meta: &api::ConnectionMeta,
9865            event: &api::ApplicationProtocolInformation,
9866        ) {
9867            self.application_protocol_information += 1;
9868            if self.location.is_some() {
9869                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
9870                let event = crate::event::snapshot::Fmt::to_snapshot(event);
9871                let out = format!("{meta:?} {event:?}");
9872                self.output.push(out);
9873            }
9874        }
9875        fn on_server_name_information(
9876            &mut self,
9877            _context: &mut Self::ConnectionContext,
9878            meta: &api::ConnectionMeta,
9879            event: &api::ServerNameInformation,
9880        ) {
9881            self.server_name_information += 1;
9882            if self.location.is_some() {
9883                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
9884                let event = crate::event::snapshot::Fmt::to_snapshot(event);
9885                let out = format!("{meta:?} {event:?}");
9886                self.output.push(out);
9887            }
9888        }
9889        fn on_key_exchange_group(
9890            &mut self,
9891            _context: &mut Self::ConnectionContext,
9892            meta: &api::ConnectionMeta,
9893            event: &api::KeyExchangeGroup,
9894        ) {
9895            self.key_exchange_group += 1;
9896            if self.location.is_some() {
9897                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
9898                let event = crate::event::snapshot::Fmt::to_snapshot(event);
9899                let out = format!("{meta:?} {event:?}");
9900                self.output.push(out);
9901            }
9902        }
9903        fn on_packet_skipped(
9904            &mut self,
9905            _context: &mut Self::ConnectionContext,
9906            meta: &api::ConnectionMeta,
9907            event: &api::PacketSkipped,
9908        ) {
9909            self.packet_skipped += 1;
9910            if self.location.is_some() {
9911                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
9912                let event = crate::event::snapshot::Fmt::to_snapshot(event);
9913                let out = format!("{meta:?} {event:?}");
9914                self.output.push(out);
9915            }
9916        }
9917        fn on_packet_sent(
9918            &mut self,
9919            _context: &mut Self::ConnectionContext,
9920            meta: &api::ConnectionMeta,
9921            event: &api::PacketSent,
9922        ) {
9923            self.packet_sent += 1;
9924            if self.location.is_some() {
9925                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
9926                let event = crate::event::snapshot::Fmt::to_snapshot(event);
9927                let out = format!("{meta:?} {event:?}");
9928                self.output.push(out);
9929            }
9930        }
9931        fn on_packet_received(
9932            &mut self,
9933            _context: &mut Self::ConnectionContext,
9934            meta: &api::ConnectionMeta,
9935            event: &api::PacketReceived,
9936        ) {
9937            self.packet_received += 1;
9938            if self.location.is_some() {
9939                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
9940                let event = crate::event::snapshot::Fmt::to_snapshot(event);
9941                let out = format!("{meta:?} {event:?}");
9942                self.output.push(out);
9943            }
9944        }
9945        fn on_active_path_updated(
9946            &mut self,
9947            _context: &mut Self::ConnectionContext,
9948            meta: &api::ConnectionMeta,
9949            event: &api::ActivePathUpdated,
9950        ) {
9951            self.active_path_updated += 1;
9952            if self.location.is_some() {
9953                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
9954                let event = crate::event::snapshot::Fmt::to_snapshot(event);
9955                let out = format!("{meta:?} {event:?}");
9956                self.output.push(out);
9957            }
9958        }
9959        fn on_path_created(
9960            &mut self,
9961            _context: &mut Self::ConnectionContext,
9962            meta: &api::ConnectionMeta,
9963            event: &api::PathCreated,
9964        ) {
9965            self.path_created += 1;
9966            if self.location.is_some() {
9967                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
9968                let event = crate::event::snapshot::Fmt::to_snapshot(event);
9969                let out = format!("{meta:?} {event:?}");
9970                self.output.push(out);
9971            }
9972        }
9973        fn on_frame_sent(
9974            &mut self,
9975            _context: &mut Self::ConnectionContext,
9976            meta: &api::ConnectionMeta,
9977            event: &api::FrameSent,
9978        ) {
9979            self.frame_sent += 1;
9980            if self.location.is_some() {
9981                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
9982                let event = crate::event::snapshot::Fmt::to_snapshot(event);
9983                let out = format!("{meta:?} {event:?}");
9984                self.output.push(out);
9985            }
9986        }
9987        fn on_frame_received(
9988            &mut self,
9989            _context: &mut Self::ConnectionContext,
9990            meta: &api::ConnectionMeta,
9991            event: &api::FrameReceived,
9992        ) {
9993            self.frame_received += 1;
9994            if self.location.is_some() {
9995                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
9996                let event = crate::event::snapshot::Fmt::to_snapshot(event);
9997                let out = format!("{meta:?} {event:?}");
9998                self.output.push(out);
9999            }
10000        }
10001        fn on_connection_close_frame_received(
10002            &mut self,
10003            _context: &mut Self::ConnectionContext,
10004            meta: &api::ConnectionMeta,
10005            event: &api::ConnectionCloseFrameReceived,
10006        ) {
10007            self.connection_close_frame_received += 1;
10008            if self.location.is_some() {
10009                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10010                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10011                let out = format!("{meta:?} {event:?}");
10012                self.output.push(out);
10013            }
10014        }
10015        fn on_packet_lost(
10016            &mut self,
10017            _context: &mut Self::ConnectionContext,
10018            meta: &api::ConnectionMeta,
10019            event: &api::PacketLost,
10020        ) {
10021            self.packet_lost += 1;
10022            if self.location.is_some() {
10023                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10024                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10025                let out = format!("{meta:?} {event:?}");
10026                self.output.push(out);
10027            }
10028        }
10029        fn on_recovery_metrics(
10030            &mut self,
10031            _context: &mut Self::ConnectionContext,
10032            meta: &api::ConnectionMeta,
10033            event: &api::RecoveryMetrics,
10034        ) {
10035            self.recovery_metrics += 1;
10036            if self.location.is_some() {
10037                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10038                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10039                let out = format!("{meta:?} {event:?}");
10040                self.output.push(out);
10041            }
10042        }
10043        fn on_congestion(
10044            &mut self,
10045            _context: &mut Self::ConnectionContext,
10046            meta: &api::ConnectionMeta,
10047            event: &api::Congestion,
10048        ) {
10049            self.congestion += 1;
10050            if self.location.is_some() {
10051                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10052                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10053                let out = format!("{meta:?} {event:?}");
10054                self.output.push(out);
10055            }
10056        }
10057        #[allow(deprecated)]
10058        fn on_ack_processed(
10059            &mut self,
10060            _context: &mut Self::ConnectionContext,
10061            meta: &api::ConnectionMeta,
10062            event: &api::AckProcessed,
10063        ) {
10064            self.ack_processed += 1;
10065            if self.location.is_some() {
10066                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10067                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10068                let out = format!("{meta:?} {event:?}");
10069                self.output.push(out);
10070            }
10071        }
10072        fn on_rx_ack_range_dropped(
10073            &mut self,
10074            _context: &mut Self::ConnectionContext,
10075            meta: &api::ConnectionMeta,
10076            event: &api::RxAckRangeDropped,
10077        ) {
10078            self.rx_ack_range_dropped += 1;
10079            if self.location.is_some() {
10080                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10081                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10082                let out = format!("{meta:?} {event:?}");
10083                self.output.push(out);
10084            }
10085        }
10086        fn on_ack_range_received(
10087            &mut self,
10088            _context: &mut Self::ConnectionContext,
10089            meta: &api::ConnectionMeta,
10090            event: &api::AckRangeReceived,
10091        ) {
10092            self.ack_range_received += 1;
10093            if self.location.is_some() {
10094                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10095                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10096                let out = format!("{meta:?} {event:?}");
10097                self.output.push(out);
10098            }
10099        }
10100        fn on_ack_range_sent(
10101            &mut self,
10102            _context: &mut Self::ConnectionContext,
10103            meta: &api::ConnectionMeta,
10104            event: &api::AckRangeSent,
10105        ) {
10106            self.ack_range_sent += 1;
10107            if self.location.is_some() {
10108                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10109                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10110                let out = format!("{meta:?} {event:?}");
10111                self.output.push(out);
10112            }
10113        }
10114        fn on_packet_dropped(
10115            &mut self,
10116            _context: &mut Self::ConnectionContext,
10117            meta: &api::ConnectionMeta,
10118            event: &api::PacketDropped,
10119        ) {
10120            self.packet_dropped += 1;
10121            if self.location.is_some() {
10122                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10123                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10124                let out = format!("{meta:?} {event:?}");
10125                self.output.push(out);
10126            }
10127        }
10128        fn on_key_update(
10129            &mut self,
10130            _context: &mut Self::ConnectionContext,
10131            meta: &api::ConnectionMeta,
10132            event: &api::KeyUpdate,
10133        ) {
10134            self.key_update += 1;
10135            if self.location.is_some() {
10136                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10137                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10138                let out = format!("{meta:?} {event:?}");
10139                self.output.push(out);
10140            }
10141        }
10142        fn on_key_space_discarded(
10143            &mut self,
10144            _context: &mut Self::ConnectionContext,
10145            meta: &api::ConnectionMeta,
10146            event: &api::KeySpaceDiscarded,
10147        ) {
10148            self.key_space_discarded += 1;
10149            if self.location.is_some() {
10150                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10151                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10152                let out = format!("{meta:?} {event:?}");
10153                self.output.push(out);
10154            }
10155        }
10156        fn on_connection_started(
10157            &mut self,
10158            _context: &mut Self::ConnectionContext,
10159            meta: &api::ConnectionMeta,
10160            event: &api::ConnectionStarted,
10161        ) {
10162            self.connection_started += 1;
10163            if self.location.is_some() {
10164                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10165                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10166                let out = format!("{meta:?} {event:?}");
10167                self.output.push(out);
10168            }
10169        }
10170        fn on_duplicate_packet(
10171            &mut self,
10172            _context: &mut Self::ConnectionContext,
10173            meta: &api::ConnectionMeta,
10174            event: &api::DuplicatePacket,
10175        ) {
10176            self.duplicate_packet += 1;
10177            if self.location.is_some() {
10178                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10179                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10180                let out = format!("{meta:?} {event:?}");
10181                self.output.push(out);
10182            }
10183        }
10184        fn on_transport_parameters_received(
10185            &mut self,
10186            _context: &mut Self::ConnectionContext,
10187            meta: &api::ConnectionMeta,
10188            event: &api::TransportParametersReceived,
10189        ) {
10190            self.transport_parameters_received += 1;
10191            if self.location.is_some() {
10192                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10193                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10194                let out = format!("{meta:?} {event:?}");
10195                self.output.push(out);
10196            }
10197        }
10198        fn on_datagram_sent(
10199            &mut self,
10200            _context: &mut Self::ConnectionContext,
10201            meta: &api::ConnectionMeta,
10202            event: &api::DatagramSent,
10203        ) {
10204            self.datagram_sent += 1;
10205            if self.location.is_some() {
10206                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10207                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10208                let out = format!("{meta:?} {event:?}");
10209                self.output.push(out);
10210            }
10211        }
10212        fn on_datagram_received(
10213            &mut self,
10214            _context: &mut Self::ConnectionContext,
10215            meta: &api::ConnectionMeta,
10216            event: &api::DatagramReceived,
10217        ) {
10218            self.datagram_received += 1;
10219            if self.location.is_some() {
10220                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10221                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10222                let out = format!("{meta:?} {event:?}");
10223                self.output.push(out);
10224            }
10225        }
10226        fn on_datagram_dropped(
10227            &mut self,
10228            _context: &mut Self::ConnectionContext,
10229            meta: &api::ConnectionMeta,
10230            event: &api::DatagramDropped,
10231        ) {
10232            self.datagram_dropped += 1;
10233            if self.location.is_some() {
10234                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10235                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10236                let out = format!("{meta:?} {event:?}");
10237                self.output.push(out);
10238            }
10239        }
10240        fn on_handshake_remote_address_change_observed(
10241            &mut self,
10242            _context: &mut Self::ConnectionContext,
10243            meta: &api::ConnectionMeta,
10244            event: &api::HandshakeRemoteAddressChangeObserved,
10245        ) {
10246            self.handshake_remote_address_change_observed += 1;
10247            if self.location.is_some() {
10248                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10249                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10250                let out = format!("{meta:?} {event:?}");
10251                self.output.push(out);
10252            }
10253        }
10254        fn on_connection_id_updated(
10255            &mut self,
10256            _context: &mut Self::ConnectionContext,
10257            meta: &api::ConnectionMeta,
10258            event: &api::ConnectionIdUpdated,
10259        ) {
10260            self.connection_id_updated += 1;
10261            if self.location.is_some() {
10262                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10263                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10264                let out = format!("{meta:?} {event:?}");
10265                self.output.push(out);
10266            }
10267        }
10268        fn on_ecn_state_changed(
10269            &mut self,
10270            _context: &mut Self::ConnectionContext,
10271            meta: &api::ConnectionMeta,
10272            event: &api::EcnStateChanged,
10273        ) {
10274            self.ecn_state_changed += 1;
10275            if self.location.is_some() {
10276                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10277                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10278                let out = format!("{meta:?} {event:?}");
10279                self.output.push(out);
10280            }
10281        }
10282        fn on_connection_migration_denied(
10283            &mut self,
10284            _context: &mut Self::ConnectionContext,
10285            meta: &api::ConnectionMeta,
10286            event: &api::ConnectionMigrationDenied,
10287        ) {
10288            self.connection_migration_denied += 1;
10289            if self.location.is_some() {
10290                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10291                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10292                let out = format!("{meta:?} {event:?}");
10293                self.output.push(out);
10294            }
10295        }
10296        fn on_handshake_status_updated(
10297            &mut self,
10298            _context: &mut Self::ConnectionContext,
10299            meta: &api::ConnectionMeta,
10300            event: &api::HandshakeStatusUpdated,
10301        ) {
10302            self.handshake_status_updated += 1;
10303            if self.location.is_some() {
10304                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10305                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10306                let out = format!("{meta:?} {event:?}");
10307                self.output.push(out);
10308            }
10309        }
10310        fn on_tls_exporter_ready(
10311            &mut self,
10312            _context: &mut Self::ConnectionContext,
10313            meta: &api::ConnectionMeta,
10314            event: &api::TlsExporterReady,
10315        ) {
10316            self.tls_exporter_ready += 1;
10317            if self.location.is_some() {
10318                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10319                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10320                let out = format!("{meta:?} {event:?}");
10321                self.output.push(out);
10322            }
10323        }
10324        fn on_tls_handshake_failed(
10325            &mut self,
10326            _context: &mut Self::ConnectionContext,
10327            meta: &api::ConnectionMeta,
10328            event: &api::TlsHandshakeFailed,
10329        ) {
10330            self.tls_handshake_failed += 1;
10331            if self.location.is_some() {
10332                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10333                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10334                let out = format!("{meta:?} {event:?}");
10335                self.output.push(out);
10336            }
10337        }
10338        fn on_path_challenge_updated(
10339            &mut self,
10340            _context: &mut Self::ConnectionContext,
10341            meta: &api::ConnectionMeta,
10342            event: &api::PathChallengeUpdated,
10343        ) {
10344            self.path_challenge_updated += 1;
10345            if self.location.is_some() {
10346                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10347                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10348                let out = format!("{meta:?} {event:?}");
10349                self.output.push(out);
10350            }
10351        }
10352        fn on_tls_client_hello(
10353            &mut self,
10354            _context: &mut Self::ConnectionContext,
10355            meta: &api::ConnectionMeta,
10356            event: &api::TlsClientHello,
10357        ) {
10358            self.tls_client_hello += 1;
10359            if self.location.is_some() {
10360                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10361                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10362                let out = format!("{meta:?} {event:?}");
10363                self.output.push(out);
10364            }
10365        }
10366        fn on_tls_server_hello(
10367            &mut self,
10368            _context: &mut Self::ConnectionContext,
10369            meta: &api::ConnectionMeta,
10370            event: &api::TlsServerHello,
10371        ) {
10372            self.tls_server_hello += 1;
10373            if self.location.is_some() {
10374                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10375                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10376                let out = format!("{meta:?} {event:?}");
10377                self.output.push(out);
10378            }
10379        }
10380        fn on_rx_stream_progress(
10381            &mut self,
10382            _context: &mut Self::ConnectionContext,
10383            meta: &api::ConnectionMeta,
10384            event: &api::RxStreamProgress,
10385        ) {
10386            self.rx_stream_progress += 1;
10387            if self.location.is_some() {
10388                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10389                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10390                let out = format!("{meta:?} {event:?}");
10391                self.output.push(out);
10392            }
10393        }
10394        fn on_tx_stream_progress(
10395            &mut self,
10396            _context: &mut Self::ConnectionContext,
10397            meta: &api::ConnectionMeta,
10398            event: &api::TxStreamProgress,
10399        ) {
10400            self.tx_stream_progress += 1;
10401            if self.location.is_some() {
10402                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10403                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10404                let out = format!("{meta:?} {event:?}");
10405                self.output.push(out);
10406            }
10407        }
10408        fn on_keep_alive_timer_expired(
10409            &mut self,
10410            _context: &mut Self::ConnectionContext,
10411            meta: &api::ConnectionMeta,
10412            event: &api::KeepAliveTimerExpired,
10413        ) {
10414            self.keep_alive_timer_expired += 1;
10415            if self.location.is_some() {
10416                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10417                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10418                let out = format!("{meta:?} {event:?}");
10419                self.output.push(out);
10420            }
10421        }
10422        fn on_mtu_updated(
10423            &mut self,
10424            _context: &mut Self::ConnectionContext,
10425            meta: &api::ConnectionMeta,
10426            event: &api::MtuUpdated,
10427        ) {
10428            self.mtu_updated += 1;
10429            if self.location.is_some() {
10430                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10431                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10432                let out = format!("{meta:?} {event:?}");
10433                self.output.push(out);
10434            }
10435        }
10436        fn on_mtu_probing_complete_received(
10437            &mut self,
10438            _context: &mut Self::ConnectionContext,
10439            meta: &api::ConnectionMeta,
10440            event: &api::MtuProbingCompleteReceived,
10441        ) {
10442            self.mtu_probing_complete_received += 1;
10443            if self.location.is_some() {
10444                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10445                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10446                let out = format!("{meta:?} {event:?}");
10447                self.output.push(out);
10448            }
10449        }
10450        fn on_slow_start_exited(
10451            &mut self,
10452            _context: &mut Self::ConnectionContext,
10453            meta: &api::ConnectionMeta,
10454            event: &api::SlowStartExited,
10455        ) {
10456            self.slow_start_exited += 1;
10457            if self.location.is_some() {
10458                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10459                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10460                let out = format!("{meta:?} {event:?}");
10461                self.output.push(out);
10462            }
10463        }
10464        fn on_delivery_rate_sampled(
10465            &mut self,
10466            _context: &mut Self::ConnectionContext,
10467            meta: &api::ConnectionMeta,
10468            event: &api::DeliveryRateSampled,
10469        ) {
10470            self.delivery_rate_sampled += 1;
10471            if self.location.is_some() {
10472                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10473                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10474                let out = format!("{meta:?} {event:?}");
10475                self.output.push(out);
10476            }
10477        }
10478        fn on_pacing_rate_updated(
10479            &mut self,
10480            _context: &mut Self::ConnectionContext,
10481            meta: &api::ConnectionMeta,
10482            event: &api::PacingRateUpdated,
10483        ) {
10484            self.pacing_rate_updated += 1;
10485            if self.location.is_some() {
10486                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10487                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10488                let out = format!("{meta:?} {event:?}");
10489                self.output.push(out);
10490            }
10491        }
10492        fn on_bbr_state_changed(
10493            &mut self,
10494            _context: &mut Self::ConnectionContext,
10495            meta: &api::ConnectionMeta,
10496            event: &api::BbrStateChanged,
10497        ) {
10498            self.bbr_state_changed += 1;
10499            if self.location.is_some() {
10500                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10501                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10502                let out = format!("{meta:?} {event:?}");
10503                self.output.push(out);
10504            }
10505        }
10506        fn on_dc_state_changed(
10507            &mut self,
10508            _context: &mut Self::ConnectionContext,
10509            meta: &api::ConnectionMeta,
10510            event: &api::DcStateChanged,
10511        ) {
10512            self.dc_state_changed += 1;
10513            if self.location.is_some() {
10514                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10515                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10516                let out = format!("{meta:?} {event:?}");
10517                self.output.push(out);
10518            }
10519        }
10520        fn on_dc_path_created(
10521            &mut self,
10522            _context: &mut Self::ConnectionContext,
10523            meta: &api::ConnectionMeta,
10524            event: &api::DcPathCreated,
10525        ) {
10526            self.dc_path_created += 1;
10527            if self.location.is_some() {
10528                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10529                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10530                let out = format!("{meta:?} {event:?}");
10531                self.output.push(out);
10532            }
10533        }
10534        fn on_connection_closed(
10535            &mut self,
10536            _context: &mut Self::ConnectionContext,
10537            meta: &api::ConnectionMeta,
10538            event: &api::ConnectionClosed,
10539        ) {
10540            self.connection_closed += 1;
10541            if self.location.is_some() {
10542                let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10543                let event = crate::event::snapshot::Fmt::to_snapshot(event);
10544                let out = format!("{meta:?} {event:?}");
10545                self.output.push(out);
10546            }
10547        }
10548        fn on_version_information(
10549            &mut self,
10550            meta: &api::EndpointMeta,
10551            event: &api::VersionInformation,
10552        ) {
10553            self.version_information += 1;
10554            let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10555            let event = crate::event::snapshot::Fmt::to_snapshot(event);
10556            let out = format!("{meta:?} {event:?}");
10557            self.output.push(out);
10558        }
10559        fn on_endpoint_packet_sent(
10560            &mut self,
10561            meta: &api::EndpointMeta,
10562            event: &api::EndpointPacketSent,
10563        ) {
10564            self.endpoint_packet_sent += 1;
10565            let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10566            let event = crate::event::snapshot::Fmt::to_snapshot(event);
10567            let out = format!("{meta:?} {event:?}");
10568            self.output.push(out);
10569        }
10570        fn on_endpoint_packet_received(
10571            &mut self,
10572            meta: &api::EndpointMeta,
10573            event: &api::EndpointPacketReceived,
10574        ) {
10575            self.endpoint_packet_received += 1;
10576            let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10577            let event = crate::event::snapshot::Fmt::to_snapshot(event);
10578            let out = format!("{meta:?} {event:?}");
10579            self.output.push(out);
10580        }
10581        fn on_endpoint_datagram_sent(
10582            &mut self,
10583            meta: &api::EndpointMeta,
10584            event: &api::EndpointDatagramSent,
10585        ) {
10586            self.endpoint_datagram_sent += 1;
10587            let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10588            let event = crate::event::snapshot::Fmt::to_snapshot(event);
10589            let out = format!("{meta:?} {event:?}");
10590            self.output.push(out);
10591        }
10592        fn on_endpoint_datagram_received(
10593            &mut self,
10594            meta: &api::EndpointMeta,
10595            event: &api::EndpointDatagramReceived,
10596        ) {
10597            self.endpoint_datagram_received += 1;
10598            let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10599            let event = crate::event::snapshot::Fmt::to_snapshot(event);
10600            let out = format!("{meta:?} {event:?}");
10601            self.output.push(out);
10602        }
10603        fn on_endpoint_datagram_dropped(
10604            &mut self,
10605            meta: &api::EndpointMeta,
10606            event: &api::EndpointDatagramDropped,
10607        ) {
10608            self.endpoint_datagram_dropped += 1;
10609            let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10610            let event = crate::event::snapshot::Fmt::to_snapshot(event);
10611            let out = format!("{meta:?} {event:?}");
10612            self.output.push(out);
10613        }
10614        fn on_endpoint_connection_attempt_failed(
10615            &mut self,
10616            meta: &api::EndpointMeta,
10617            event: &api::EndpointConnectionAttemptFailed,
10618        ) {
10619            self.endpoint_connection_attempt_failed += 1;
10620            let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10621            let event = crate::event::snapshot::Fmt::to_snapshot(event);
10622            let out = format!("{meta:?} {event:?}");
10623            self.output.push(out);
10624        }
10625        fn on_endpoint_connection_attempt_deduplicated(
10626            &mut self,
10627            meta: &api::EndpointMeta,
10628            event: &api::EndpointConnectionAttemptDeduplicated,
10629        ) {
10630            self.endpoint_connection_attempt_deduplicated += 1;
10631            let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10632            let event = crate::event::snapshot::Fmt::to_snapshot(event);
10633            let out = format!("{meta:?} {event:?}");
10634            self.output.push(out);
10635        }
10636        fn on_platform_tx(&mut self, meta: &api::EndpointMeta, event: &api::PlatformTx) {
10637            self.platform_tx += 1;
10638            let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10639            let event = crate::event::snapshot::Fmt::to_snapshot(event);
10640            let out = format!("{meta:?} {event:?}");
10641            self.output.push(out);
10642        }
10643        fn on_platform_tx_error(&mut self, meta: &api::EndpointMeta, event: &api::PlatformTxError) {
10644            self.platform_tx_error += 1;
10645            let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10646            let event = crate::event::snapshot::Fmt::to_snapshot(event);
10647            let out = format!("{meta:?} {event:?}");
10648            self.output.push(out);
10649        }
10650        fn on_platform_rx(&mut self, meta: &api::EndpointMeta, event: &api::PlatformRx) {
10651            self.platform_rx += 1;
10652            let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10653            let event = crate::event::snapshot::Fmt::to_snapshot(event);
10654            let out = format!("{meta:?} {event:?}");
10655            self.output.push(out);
10656        }
10657        fn on_platform_rx_error(&mut self, meta: &api::EndpointMeta, event: &api::PlatformRxError) {
10658            self.platform_rx_error += 1;
10659            let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10660            let event = crate::event::snapshot::Fmt::to_snapshot(event);
10661            let out = format!("{meta:?} {event:?}");
10662            self.output.push(out);
10663        }
10664        fn on_platform_feature_configured(
10665            &mut self,
10666            meta: &api::EndpointMeta,
10667            event: &api::PlatformFeatureConfigured,
10668        ) {
10669            self.platform_feature_configured += 1;
10670            let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10671            let event = crate::event::snapshot::Fmt::to_snapshot(event);
10672            let out = format!("{meta:?} {event:?}");
10673            self.output.push(out);
10674        }
10675        fn on_platform_event_loop_wakeup(
10676            &mut self,
10677            meta: &api::EndpointMeta,
10678            event: &api::PlatformEventLoopWakeup,
10679        ) {
10680            self.platform_event_loop_wakeup += 1;
10681            let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10682            let event = crate::event::snapshot::Fmt::to_snapshot(event);
10683            let out = format!("{meta:?} {event:?}");
10684            self.output.push(out);
10685        }
10686        fn on_platform_event_loop_sleep(
10687            &mut self,
10688            meta: &api::EndpointMeta,
10689            event: &api::PlatformEventLoopSleep,
10690        ) {
10691            self.platform_event_loop_sleep += 1;
10692            let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10693            let event = crate::event::snapshot::Fmt::to_snapshot(event);
10694            let out = format!("{meta:?} {event:?}");
10695            self.output.push(out);
10696        }
10697        fn on_platform_event_loop_started(
10698            &mut self,
10699            meta: &api::EndpointMeta,
10700            event: &api::PlatformEventLoopStarted,
10701        ) {
10702            self.platform_event_loop_started += 1;
10703            let meta = crate::event::snapshot::Fmt::to_snapshot(meta);
10704            let event = crate::event::snapshot::Fmt::to_snapshot(event);
10705            let out = format!("{meta:?} {event:?}");
10706            self.output.push(out);
10707        }
10708    }
10709    #[derive(Debug)]
10710    pub struct Publisher {
10711        location: Option<Location>,
10712        output: Vec<String>,
10713        pub application_protocol_information: u64,
10714        pub server_name_information: u64,
10715        pub key_exchange_group: u64,
10716        pub packet_skipped: u64,
10717        pub packet_sent: u64,
10718        pub packet_received: u64,
10719        pub active_path_updated: u64,
10720        pub path_created: u64,
10721        pub frame_sent: u64,
10722        pub frame_received: u64,
10723        pub connection_close_frame_received: u64,
10724        pub packet_lost: u64,
10725        pub recovery_metrics: u64,
10726        pub congestion: u64,
10727        pub ack_processed: u64,
10728        pub rx_ack_range_dropped: u64,
10729        pub ack_range_received: u64,
10730        pub ack_range_sent: u64,
10731        pub packet_dropped: u64,
10732        pub key_update: u64,
10733        pub key_space_discarded: u64,
10734        pub connection_started: u64,
10735        pub duplicate_packet: u64,
10736        pub transport_parameters_received: u64,
10737        pub datagram_sent: u64,
10738        pub datagram_received: u64,
10739        pub datagram_dropped: u64,
10740        pub handshake_remote_address_change_observed: u64,
10741        pub connection_id_updated: u64,
10742        pub ecn_state_changed: u64,
10743        pub connection_migration_denied: u64,
10744        pub handshake_status_updated: u64,
10745        pub tls_exporter_ready: u64,
10746        pub tls_handshake_failed: u64,
10747        pub path_challenge_updated: u64,
10748        pub tls_client_hello: u64,
10749        pub tls_server_hello: u64,
10750        pub rx_stream_progress: u64,
10751        pub tx_stream_progress: u64,
10752        pub keep_alive_timer_expired: u64,
10753        pub mtu_updated: u64,
10754        pub mtu_probing_complete_received: u64,
10755        pub slow_start_exited: u64,
10756        pub delivery_rate_sampled: u64,
10757        pub pacing_rate_updated: u64,
10758        pub bbr_state_changed: u64,
10759        pub dc_state_changed: u64,
10760        pub dc_path_created: u64,
10761        pub connection_closed: u64,
10762        pub version_information: u64,
10763        pub endpoint_packet_sent: u64,
10764        pub endpoint_packet_received: u64,
10765        pub endpoint_datagram_sent: u64,
10766        pub endpoint_datagram_received: u64,
10767        pub endpoint_datagram_dropped: u64,
10768        pub endpoint_connection_attempt_failed: u64,
10769        pub endpoint_connection_attempt_deduplicated: u64,
10770        pub platform_tx: u64,
10771        pub platform_tx_error: u64,
10772        pub platform_rx: u64,
10773        pub platform_rx_error: u64,
10774        pub platform_feature_configured: u64,
10775        pub platform_event_loop_wakeup: u64,
10776        pub platform_event_loop_sleep: u64,
10777        pub platform_event_loop_started: u64,
10778    }
10779    impl Publisher {
10780        #[doc = r" Creates a publisher with snapshot assertions enabled"]
10781        #[track_caller]
10782        pub fn snapshot() -> Self {
10783            let mut sub = Self::no_snapshot();
10784            sub.location = Location::from_thread_name();
10785            sub
10786        }
10787        #[doc = r" Creates a subscriber with snapshot assertions enabled"]
10788        #[track_caller]
10789        pub fn named_snapshot<Name: core::fmt::Display>(name: Name) -> Self {
10790            let mut sub = Self::no_snapshot();
10791            sub.location = Some(Location::new(name));
10792            sub
10793        }
10794        #[doc = r" Creates a publisher with snapshot assertions disabled"]
10795        pub fn no_snapshot() -> Self {
10796            Self {
10797                location: None,
10798                output: Default::default(),
10799                application_protocol_information: 0,
10800                server_name_information: 0,
10801                key_exchange_group: 0,
10802                packet_skipped: 0,
10803                packet_sent: 0,
10804                packet_received: 0,
10805                active_path_updated: 0,
10806                path_created: 0,
10807                frame_sent: 0,
10808                frame_received: 0,
10809                connection_close_frame_received: 0,
10810                packet_lost: 0,
10811                recovery_metrics: 0,
10812                congestion: 0,
10813                ack_processed: 0,
10814                rx_ack_range_dropped: 0,
10815                ack_range_received: 0,
10816                ack_range_sent: 0,
10817                packet_dropped: 0,
10818                key_update: 0,
10819                key_space_discarded: 0,
10820                connection_started: 0,
10821                duplicate_packet: 0,
10822                transport_parameters_received: 0,
10823                datagram_sent: 0,
10824                datagram_received: 0,
10825                datagram_dropped: 0,
10826                handshake_remote_address_change_observed: 0,
10827                connection_id_updated: 0,
10828                ecn_state_changed: 0,
10829                connection_migration_denied: 0,
10830                handshake_status_updated: 0,
10831                tls_exporter_ready: 0,
10832                tls_handshake_failed: 0,
10833                path_challenge_updated: 0,
10834                tls_client_hello: 0,
10835                tls_server_hello: 0,
10836                rx_stream_progress: 0,
10837                tx_stream_progress: 0,
10838                keep_alive_timer_expired: 0,
10839                mtu_updated: 0,
10840                mtu_probing_complete_received: 0,
10841                slow_start_exited: 0,
10842                delivery_rate_sampled: 0,
10843                pacing_rate_updated: 0,
10844                bbr_state_changed: 0,
10845                dc_state_changed: 0,
10846                dc_path_created: 0,
10847                connection_closed: 0,
10848                version_information: 0,
10849                endpoint_packet_sent: 0,
10850                endpoint_packet_received: 0,
10851                endpoint_datagram_sent: 0,
10852                endpoint_datagram_received: 0,
10853                endpoint_datagram_dropped: 0,
10854                endpoint_connection_attempt_failed: 0,
10855                endpoint_connection_attempt_deduplicated: 0,
10856                platform_tx: 0,
10857                platform_tx_error: 0,
10858                platform_rx: 0,
10859                platform_rx_error: 0,
10860                platform_feature_configured: 0,
10861                platform_event_loop_wakeup: 0,
10862                platform_event_loop_sleep: 0,
10863                platform_event_loop_started: 0,
10864            }
10865        }
10866    }
10867    impl super::EndpointPublisher for Publisher {
10868        fn on_version_information(&mut self, event: builder::VersionInformation) {
10869            self.version_information += 1;
10870            let event = event.into_event();
10871            let event = crate::event::snapshot::Fmt::to_snapshot(&event);
10872            let out = format!("{event:?}");
10873            self.output.push(out);
10874        }
10875        fn on_endpoint_packet_sent(&mut self, event: builder::EndpointPacketSent) {
10876            self.endpoint_packet_sent += 1;
10877            let event = event.into_event();
10878            let event = crate::event::snapshot::Fmt::to_snapshot(&event);
10879            let out = format!("{event:?}");
10880            self.output.push(out);
10881        }
10882        fn on_endpoint_packet_received(&mut self, event: builder::EndpointPacketReceived) {
10883            self.endpoint_packet_received += 1;
10884            let event = event.into_event();
10885            let event = crate::event::snapshot::Fmt::to_snapshot(&event);
10886            let out = format!("{event:?}");
10887            self.output.push(out);
10888        }
10889        fn on_endpoint_datagram_sent(&mut self, event: builder::EndpointDatagramSent) {
10890            self.endpoint_datagram_sent += 1;
10891            let event = event.into_event();
10892            let event = crate::event::snapshot::Fmt::to_snapshot(&event);
10893            let out = format!("{event:?}");
10894            self.output.push(out);
10895        }
10896        fn on_endpoint_datagram_received(&mut self, event: builder::EndpointDatagramReceived) {
10897            self.endpoint_datagram_received += 1;
10898            let event = event.into_event();
10899            let event = crate::event::snapshot::Fmt::to_snapshot(&event);
10900            let out = format!("{event:?}");
10901            self.output.push(out);
10902        }
10903        fn on_endpoint_datagram_dropped(&mut self, event: builder::EndpointDatagramDropped) {
10904            self.endpoint_datagram_dropped += 1;
10905            let event = event.into_event();
10906            let event = crate::event::snapshot::Fmt::to_snapshot(&event);
10907            let out = format!("{event:?}");
10908            self.output.push(out);
10909        }
10910        fn on_endpoint_connection_attempt_failed(
10911            &mut self,
10912            event: builder::EndpointConnectionAttemptFailed,
10913        ) {
10914            self.endpoint_connection_attempt_failed += 1;
10915            let event = event.into_event();
10916            let event = crate::event::snapshot::Fmt::to_snapshot(&event);
10917            let out = format!("{event:?}");
10918            self.output.push(out);
10919        }
10920        fn on_endpoint_connection_attempt_deduplicated(
10921            &mut self,
10922            event: builder::EndpointConnectionAttemptDeduplicated,
10923        ) {
10924            self.endpoint_connection_attempt_deduplicated += 1;
10925            let event = event.into_event();
10926            let event = crate::event::snapshot::Fmt::to_snapshot(&event);
10927            let out = format!("{event:?}");
10928            self.output.push(out);
10929        }
10930        fn on_platform_tx(&mut self, event: builder::PlatformTx) {
10931            self.platform_tx += 1;
10932            let event = event.into_event();
10933            let event = crate::event::snapshot::Fmt::to_snapshot(&event);
10934            let out = format!("{event:?}");
10935            self.output.push(out);
10936        }
10937        fn on_platform_tx_error(&mut self, event: builder::PlatformTxError) {
10938            self.platform_tx_error += 1;
10939            let event = event.into_event();
10940            let event = crate::event::snapshot::Fmt::to_snapshot(&event);
10941            let out = format!("{event:?}");
10942            self.output.push(out);
10943        }
10944        fn on_platform_rx(&mut self, event: builder::PlatformRx) {
10945            self.platform_rx += 1;
10946            let event = event.into_event();
10947            let event = crate::event::snapshot::Fmt::to_snapshot(&event);
10948            let out = format!("{event:?}");
10949            self.output.push(out);
10950        }
10951        fn on_platform_rx_error(&mut self, event: builder::PlatformRxError) {
10952            self.platform_rx_error += 1;
10953            let event = event.into_event();
10954            let event = crate::event::snapshot::Fmt::to_snapshot(&event);
10955            let out = format!("{event:?}");
10956            self.output.push(out);
10957        }
10958        fn on_platform_feature_configured(&mut self, event: builder::PlatformFeatureConfigured) {
10959            self.platform_feature_configured += 1;
10960            let event = event.into_event();
10961            let event = crate::event::snapshot::Fmt::to_snapshot(&event);
10962            let out = format!("{event:?}");
10963            self.output.push(out);
10964        }
10965        fn on_platform_event_loop_wakeup(&mut self, event: builder::PlatformEventLoopWakeup) {
10966            self.platform_event_loop_wakeup += 1;
10967            let event = event.into_event();
10968            let event = crate::event::snapshot::Fmt::to_snapshot(&event);
10969            let out = format!("{event:?}");
10970            self.output.push(out);
10971        }
10972        fn on_platform_event_loop_sleep(&mut self, event: builder::PlatformEventLoopSleep) {
10973            self.platform_event_loop_sleep += 1;
10974            let event = event.into_event();
10975            let event = crate::event::snapshot::Fmt::to_snapshot(&event);
10976            let out = format!("{event:?}");
10977            self.output.push(out);
10978        }
10979        fn on_platform_event_loop_started(&mut self, event: builder::PlatformEventLoopStarted) {
10980            self.platform_event_loop_started += 1;
10981            let event = event.into_event();
10982            let event = crate::event::snapshot::Fmt::to_snapshot(&event);
10983            let out = format!("{event:?}");
10984            self.output.push(out);
10985        }
10986        fn quic_version(&self) -> Option<u32> {
10987            Some(1)
10988        }
10989    }
10990    impl super::ConnectionPublisher for Publisher {
10991        fn on_application_protocol_information(
10992            &mut self,
10993            event: builder::ApplicationProtocolInformation,
10994        ) {
10995            self.application_protocol_information += 1;
10996            let event = event.into_event();
10997            if self.location.is_some() {
10998                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
10999                let out = format!("{event:?}");
11000                self.output.push(out);
11001            }
11002        }
11003        fn on_server_name_information(&mut self, event: builder::ServerNameInformation) {
11004            self.server_name_information += 1;
11005            let event = event.into_event();
11006            if self.location.is_some() {
11007                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11008                let out = format!("{event:?}");
11009                self.output.push(out);
11010            }
11011        }
11012        fn on_key_exchange_group(&mut self, event: builder::KeyExchangeGroup) {
11013            self.key_exchange_group += 1;
11014            let event = event.into_event();
11015            if self.location.is_some() {
11016                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11017                let out = format!("{event:?}");
11018                self.output.push(out);
11019            }
11020        }
11021        fn on_packet_skipped(&mut self, event: builder::PacketSkipped) {
11022            self.packet_skipped += 1;
11023            let event = event.into_event();
11024            if self.location.is_some() {
11025                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11026                let out = format!("{event:?}");
11027                self.output.push(out);
11028            }
11029        }
11030        fn on_packet_sent(&mut self, event: builder::PacketSent) {
11031            self.packet_sent += 1;
11032            let event = event.into_event();
11033            if self.location.is_some() {
11034                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11035                let out = format!("{event:?}");
11036                self.output.push(out);
11037            }
11038        }
11039        fn on_packet_received(&mut self, event: builder::PacketReceived) {
11040            self.packet_received += 1;
11041            let event = event.into_event();
11042            if self.location.is_some() {
11043                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11044                let out = format!("{event:?}");
11045                self.output.push(out);
11046            }
11047        }
11048        fn on_active_path_updated(&mut self, event: builder::ActivePathUpdated) {
11049            self.active_path_updated += 1;
11050            let event = event.into_event();
11051            if self.location.is_some() {
11052                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11053                let out = format!("{event:?}");
11054                self.output.push(out);
11055            }
11056        }
11057        fn on_path_created(&mut self, event: builder::PathCreated) {
11058            self.path_created += 1;
11059            let event = event.into_event();
11060            if self.location.is_some() {
11061                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11062                let out = format!("{event:?}");
11063                self.output.push(out);
11064            }
11065        }
11066        fn on_frame_sent(&mut self, event: builder::FrameSent) {
11067            self.frame_sent += 1;
11068            let event = event.into_event();
11069            if self.location.is_some() {
11070                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11071                let out = format!("{event:?}");
11072                self.output.push(out);
11073            }
11074        }
11075        fn on_frame_received(&mut self, event: builder::FrameReceived) {
11076            self.frame_received += 1;
11077            let event = event.into_event();
11078            if self.location.is_some() {
11079                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11080                let out = format!("{event:?}");
11081                self.output.push(out);
11082            }
11083        }
11084        fn on_connection_close_frame_received(
11085            &mut self,
11086            event: builder::ConnectionCloseFrameReceived,
11087        ) {
11088            self.connection_close_frame_received += 1;
11089            let event = event.into_event();
11090            if self.location.is_some() {
11091                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11092                let out = format!("{event:?}");
11093                self.output.push(out);
11094            }
11095        }
11096        fn on_packet_lost(&mut self, event: builder::PacketLost) {
11097            self.packet_lost += 1;
11098            let event = event.into_event();
11099            if self.location.is_some() {
11100                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11101                let out = format!("{event:?}");
11102                self.output.push(out);
11103            }
11104        }
11105        fn on_recovery_metrics(&mut self, event: builder::RecoveryMetrics) {
11106            self.recovery_metrics += 1;
11107            let event = event.into_event();
11108            if self.location.is_some() {
11109                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11110                let out = format!("{event:?}");
11111                self.output.push(out);
11112            }
11113        }
11114        fn on_congestion(&mut self, event: builder::Congestion) {
11115            self.congestion += 1;
11116            let event = event.into_event();
11117            if self.location.is_some() {
11118                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11119                let out = format!("{event:?}");
11120                self.output.push(out);
11121            }
11122        }
11123        #[allow(deprecated)]
11124        fn on_ack_processed(&mut self, event: builder::AckProcessed) {
11125            self.ack_processed += 1;
11126            let event = event.into_event();
11127            if self.location.is_some() {
11128                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11129                let out = format!("{event:?}");
11130                self.output.push(out);
11131            }
11132        }
11133        fn on_rx_ack_range_dropped(&mut self, event: builder::RxAckRangeDropped) {
11134            self.rx_ack_range_dropped += 1;
11135            let event = event.into_event();
11136            if self.location.is_some() {
11137                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11138                let out = format!("{event:?}");
11139                self.output.push(out);
11140            }
11141        }
11142        fn on_ack_range_received(&mut self, event: builder::AckRangeReceived) {
11143            self.ack_range_received += 1;
11144            let event = event.into_event();
11145            if self.location.is_some() {
11146                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11147                let out = format!("{event:?}");
11148                self.output.push(out);
11149            }
11150        }
11151        fn on_ack_range_sent(&mut self, event: builder::AckRangeSent) {
11152            self.ack_range_sent += 1;
11153            let event = event.into_event();
11154            if self.location.is_some() {
11155                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11156                let out = format!("{event:?}");
11157                self.output.push(out);
11158            }
11159        }
11160        fn on_packet_dropped(&mut self, event: builder::PacketDropped) {
11161            self.packet_dropped += 1;
11162            let event = event.into_event();
11163            if self.location.is_some() {
11164                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11165                let out = format!("{event:?}");
11166                self.output.push(out);
11167            }
11168        }
11169        fn on_key_update(&mut self, event: builder::KeyUpdate) {
11170            self.key_update += 1;
11171            let event = event.into_event();
11172            if self.location.is_some() {
11173                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11174                let out = format!("{event:?}");
11175                self.output.push(out);
11176            }
11177        }
11178        fn on_key_space_discarded(&mut self, event: builder::KeySpaceDiscarded) {
11179            self.key_space_discarded += 1;
11180            let event = event.into_event();
11181            if self.location.is_some() {
11182                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11183                let out = format!("{event:?}");
11184                self.output.push(out);
11185            }
11186        }
11187        fn on_connection_started(&mut self, event: builder::ConnectionStarted) {
11188            self.connection_started += 1;
11189            let event = event.into_event();
11190            if self.location.is_some() {
11191                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11192                let out = format!("{event:?}");
11193                self.output.push(out);
11194            }
11195        }
11196        fn on_duplicate_packet(&mut self, event: builder::DuplicatePacket) {
11197            self.duplicate_packet += 1;
11198            let event = event.into_event();
11199            if self.location.is_some() {
11200                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11201                let out = format!("{event:?}");
11202                self.output.push(out);
11203            }
11204        }
11205        fn on_transport_parameters_received(
11206            &mut self,
11207            event: builder::TransportParametersReceived,
11208        ) {
11209            self.transport_parameters_received += 1;
11210            let event = event.into_event();
11211            if self.location.is_some() {
11212                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11213                let out = format!("{event:?}");
11214                self.output.push(out);
11215            }
11216        }
11217        fn on_datagram_sent(&mut self, event: builder::DatagramSent) {
11218            self.datagram_sent += 1;
11219            let event = event.into_event();
11220            if self.location.is_some() {
11221                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11222                let out = format!("{event:?}");
11223                self.output.push(out);
11224            }
11225        }
11226        fn on_datagram_received(&mut self, event: builder::DatagramReceived) {
11227            self.datagram_received += 1;
11228            let event = event.into_event();
11229            if self.location.is_some() {
11230                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11231                let out = format!("{event:?}");
11232                self.output.push(out);
11233            }
11234        }
11235        fn on_datagram_dropped(&mut self, event: builder::DatagramDropped) {
11236            self.datagram_dropped += 1;
11237            let event = event.into_event();
11238            if self.location.is_some() {
11239                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11240                let out = format!("{event:?}");
11241                self.output.push(out);
11242            }
11243        }
11244        fn on_handshake_remote_address_change_observed(
11245            &mut self,
11246            event: builder::HandshakeRemoteAddressChangeObserved,
11247        ) {
11248            self.handshake_remote_address_change_observed += 1;
11249            let event = event.into_event();
11250            if self.location.is_some() {
11251                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11252                let out = format!("{event:?}");
11253                self.output.push(out);
11254            }
11255        }
11256        fn on_connection_id_updated(&mut self, event: builder::ConnectionIdUpdated) {
11257            self.connection_id_updated += 1;
11258            let event = event.into_event();
11259            if self.location.is_some() {
11260                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11261                let out = format!("{event:?}");
11262                self.output.push(out);
11263            }
11264        }
11265        fn on_ecn_state_changed(&mut self, event: builder::EcnStateChanged) {
11266            self.ecn_state_changed += 1;
11267            let event = event.into_event();
11268            if self.location.is_some() {
11269                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11270                let out = format!("{event:?}");
11271                self.output.push(out);
11272            }
11273        }
11274        fn on_connection_migration_denied(&mut self, event: builder::ConnectionMigrationDenied) {
11275            self.connection_migration_denied += 1;
11276            let event = event.into_event();
11277            if self.location.is_some() {
11278                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11279                let out = format!("{event:?}");
11280                self.output.push(out);
11281            }
11282        }
11283        fn on_handshake_status_updated(&mut self, event: builder::HandshakeStatusUpdated) {
11284            self.handshake_status_updated += 1;
11285            let event = event.into_event();
11286            if self.location.is_some() {
11287                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11288                let out = format!("{event:?}");
11289                self.output.push(out);
11290            }
11291        }
11292        fn on_tls_exporter_ready(&mut self, event: builder::TlsExporterReady) {
11293            self.tls_exporter_ready += 1;
11294            let event = event.into_event();
11295            if self.location.is_some() {
11296                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11297                let out = format!("{event:?}");
11298                self.output.push(out);
11299            }
11300        }
11301        fn on_tls_handshake_failed(&mut self, event: builder::TlsHandshakeFailed) {
11302            self.tls_handshake_failed += 1;
11303            let event = event.into_event();
11304            if self.location.is_some() {
11305                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11306                let out = format!("{event:?}");
11307                self.output.push(out);
11308            }
11309        }
11310        fn on_path_challenge_updated(&mut self, event: builder::PathChallengeUpdated) {
11311            self.path_challenge_updated += 1;
11312            let event = event.into_event();
11313            if self.location.is_some() {
11314                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11315                let out = format!("{event:?}");
11316                self.output.push(out);
11317            }
11318        }
11319        fn on_tls_client_hello(&mut self, event: builder::TlsClientHello) {
11320            self.tls_client_hello += 1;
11321            let event = event.into_event();
11322            if self.location.is_some() {
11323                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11324                let out = format!("{event:?}");
11325                self.output.push(out);
11326            }
11327        }
11328        fn on_tls_server_hello(&mut self, event: builder::TlsServerHello) {
11329            self.tls_server_hello += 1;
11330            let event = event.into_event();
11331            if self.location.is_some() {
11332                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11333                let out = format!("{event:?}");
11334                self.output.push(out);
11335            }
11336        }
11337        fn on_rx_stream_progress(&mut self, event: builder::RxStreamProgress) {
11338            self.rx_stream_progress += 1;
11339            let event = event.into_event();
11340            if self.location.is_some() {
11341                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11342                let out = format!("{event:?}");
11343                self.output.push(out);
11344            }
11345        }
11346        fn on_tx_stream_progress(&mut self, event: builder::TxStreamProgress) {
11347            self.tx_stream_progress += 1;
11348            let event = event.into_event();
11349            if self.location.is_some() {
11350                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11351                let out = format!("{event:?}");
11352                self.output.push(out);
11353            }
11354        }
11355        fn on_keep_alive_timer_expired(&mut self, event: builder::KeepAliveTimerExpired) {
11356            self.keep_alive_timer_expired += 1;
11357            let event = event.into_event();
11358            if self.location.is_some() {
11359                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11360                let out = format!("{event:?}");
11361                self.output.push(out);
11362            }
11363        }
11364        fn on_mtu_updated(&mut self, event: builder::MtuUpdated) {
11365            self.mtu_updated += 1;
11366            let event = event.into_event();
11367            if self.location.is_some() {
11368                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11369                let out = format!("{event:?}");
11370                self.output.push(out);
11371            }
11372        }
11373        fn on_mtu_probing_complete_received(&mut self, event: builder::MtuProbingCompleteReceived) {
11374            self.mtu_probing_complete_received += 1;
11375            let event = event.into_event();
11376            if self.location.is_some() {
11377                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11378                let out = format!("{event:?}");
11379                self.output.push(out);
11380            }
11381        }
11382        fn on_slow_start_exited(&mut self, event: builder::SlowStartExited) {
11383            self.slow_start_exited += 1;
11384            let event = event.into_event();
11385            if self.location.is_some() {
11386                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11387                let out = format!("{event:?}");
11388                self.output.push(out);
11389            }
11390        }
11391        fn on_delivery_rate_sampled(&mut self, event: builder::DeliveryRateSampled) {
11392            self.delivery_rate_sampled += 1;
11393            let event = event.into_event();
11394            if self.location.is_some() {
11395                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11396                let out = format!("{event:?}");
11397                self.output.push(out);
11398            }
11399        }
11400        fn on_pacing_rate_updated(&mut self, event: builder::PacingRateUpdated) {
11401            self.pacing_rate_updated += 1;
11402            let event = event.into_event();
11403            if self.location.is_some() {
11404                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11405                let out = format!("{event:?}");
11406                self.output.push(out);
11407            }
11408        }
11409        fn on_bbr_state_changed(&mut self, event: builder::BbrStateChanged) {
11410            self.bbr_state_changed += 1;
11411            let event = event.into_event();
11412            if self.location.is_some() {
11413                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11414                let out = format!("{event:?}");
11415                self.output.push(out);
11416            }
11417        }
11418        fn on_dc_state_changed(&mut self, event: builder::DcStateChanged) {
11419            self.dc_state_changed += 1;
11420            let event = event.into_event();
11421            if self.location.is_some() {
11422                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11423                let out = format!("{event:?}");
11424                self.output.push(out);
11425            }
11426        }
11427        fn on_dc_path_created(&mut self, event: builder::DcPathCreated) {
11428            self.dc_path_created += 1;
11429            let event = event.into_event();
11430            if self.location.is_some() {
11431                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11432                let out = format!("{event:?}");
11433                self.output.push(out);
11434            }
11435        }
11436        fn on_connection_closed(&mut self, event: builder::ConnectionClosed) {
11437            self.connection_closed += 1;
11438            let event = event.into_event();
11439            if self.location.is_some() {
11440                let event = crate::event::snapshot::Fmt::to_snapshot(&event);
11441                let out = format!("{event:?}");
11442                self.output.push(out);
11443            }
11444        }
11445        fn quic_version(&self) -> u32 {
11446            1
11447        }
11448        fn subject(&self) -> api::Subject {
11449            builder::Subject::Connection { id: 0 }.into_event()
11450        }
11451    }
11452    impl Drop for Publisher {
11453        fn drop(&mut self) {
11454            if std::thread::panicking() {
11455                return;
11456            }
11457            if let Some(location) = self.location.as_ref() {
11458                location.snapshot_log(&self.output);
11459            }
11460        }
11461    }
11462}