[][src]Trait rustracing::sampler::Sampler

pub trait Sampler<T> {
    fn is_sampled(&self, span: &CandidateSpan<T>) -> bool;

    fn or<U>(self, other: U) -> OrSampler<Self, U>
    where
        Self: Sized,
        U: Sampler<T>
, { ... }
fn and<U>(self, other: U) -> AndSampler<Self, U>
    where
        Self: Sized,
        U: Sampler<T>
, { ... }
fn boxed(self) -> BoxSampler<T>
    where
        Self: Sized + Send + Sync + 'static
, { ... } }

Sampler decides whether a new trace should be sampled or not.

Required methods

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

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

Loading content...

Provided methods

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.

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.

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

Converts into BoxSampler.

Loading content...

Implementors

impl<A, B, T> Sampler<T> for AndSampler<A, B> where
    A: Sampler<T>,
    B: Sampler<T>, 
[src]

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

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

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

impl<A, B, T> Sampler<T> for OrSampler<A, B> where
    A: Sampler<T>,
    B: Sampler<T>, 
[src]

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

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

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

impl<T> Sampler<T> for AllSampler[src]

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

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

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

impl<T> Sampler<T> for NullSampler[src]

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

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

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

impl<T> Sampler<T> for PassiveSampler[src]

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

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

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

impl<T> Sampler<T> for ProbabilisticSampler[src]

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

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

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

impl<T> Sampler<T> for BoxSampler<T>[src]

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

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

Loading content...