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 + Send + Sync;
fn start(self) -> Result<Self::Subscriber, Self::Error>;
}
pub mod disabled;
#[cfg(any(feature = "provider-event-tracing", test))]
pub mod tracing;
#[cfg(feature = "provider-event-console-perf")]
pub mod console_perf;
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!();