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