BoxSampler

Type Alias BoxSampler 

Source
pub type BoxSampler<T> = Box<dyn Sampler<T> + Send + Sync + 'static>;
Expand description

Boxed version of Sampler.

Aliased Type§

pub struct BoxSampler<T>(/* private fields */);

Trait Implementations§

Source§

impl<T> Sampler<T> for BoxSampler<T>

Source§

fn is_sampled(&self, span: &CandidateSpan<'_, T>) -> bool

This method decides whether a trace with given span should be sampled.
Source§

fn boxed(self) -> BoxSampler<T>
where Self: Sized + Send + 'static,

Converts into BoxSampler.
Source§

fn or<U>(self, other: U) -> OrSampler<Self, U>
where Self: Sized, U: Sampler<T>,

Returns the sampler that samples a trace if self or other decides to sample it.
Source§

fn and<U>(self, other: U) -> AndSampler<Self, U>
where Self: Sized, U: Sampler<T>,

Returns the sampler that samples a trace if both of self and other decides to sample it.