use tracing_subscriber::registry::{LookupSpan, SpanRef};
#[cfg(feature = "sampler-probabilistic")]
pub mod probabilistic;
pub trait HeadSampler {
const ENABLED: bool = true;
fn should_sample<S>(&self, span: &SpanRef<S>) -> bool
where
S: for<'a> LookupSpan<'a>;
}
#[derive(Debug, Clone, Copy)]
pub struct AlwaysSample;
impl HeadSampler for AlwaysSample {
const ENABLED: bool = false;
#[inline]
fn should_sample<S>(&self, _span: &SpanRef<S>) -> bool
where
S: for<'a> LookupSpan<'a>,
{
true
}
}