s2n_quic/provider/event/
mod.rs1use cfg_if::cfg_if;
7pub use s2n_quic_core::{
8 endpoint::Location,
9 event::{
10 api as events,
11 api::{ConnectionInfo, ConnectionMeta},
12 supervisor, Event, Meta, Subscriber, Timestamp,
13 },
14 query,
15};
16
17pub trait Provider {
19 type Subscriber: 'static + Subscriber;
20 type Error: 'static + core::fmt::Display + Send + Sync;
21
22 fn start(self) -> Result<Self::Subscriber, Self::Error>;
23}
24
25pub mod disabled;
27
28#[cfg(any(feature = "provider-event-tracing", test))]
30pub mod tracing;
31
32#[cfg(feature = "provider-event-console-perf")]
34pub mod console_perf;
35
36cfg_if! {
37 if #[cfg(any(feature = "provider-event-tracing", test))] {
38 pub use self::tracing as default;
39 } else {
40 pub use self::disabled as default;
42 }
43}
44
45pub use default::Provider as Default;
46
47impl<S> Provider for S
48where
49 S: 'static + Subscriber,
50{
51 type Subscriber = S;
52 type Error = core::convert::Infallible;
53
54 fn start(self) -> Result<S, Self::Error> {
55 Ok(self)
56 }
57}
58
59impl_provider_utils!();