Skip to main content

Source

Trait Source 

Source
pub trait Source {
    // Required method
    fn sample_metrics<S: Sampler>(&self, sampler: S);

    // Provided method
    fn and_sample<U>(self, other: U) -> And<Self, U>
       where Self: Sized { ... }
}
Expand description

A source of Metrics.

Required Methods§

Source

fn sample_metrics<S: Sampler>(&self, sampler: S)

Produce a current sample for all metrics in the source.

Provided Methods§

Source

fn and_sample<U>(self, other: U) -> And<Self, U>
where Self: Sized,

Chain this source to other, sampling metrics from both.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a, T: Source + ?Sized + 'a> Source for Box<T>

Available on crate feature alloc only.
Source§

fn sample_metrics<S: Sampler>(&self, sampler: S)

Source§

impl<'a, T: Source + ?Sized + 'a> Source for Arc<T>

Available on crate feature alloc only.
Source§

fn sample_metrics<S: Sampler>(&self, sampler: S)

Source§

impl<'a, T: Source + ?Sized> Source for &'a T

Source§

fn sample_metrics<S: Sampler>(&self, sampler: S)

Source§

impl<T: Source> Source for Option<T>

Source§

fn sample_metrics<S: Sampler>(&self, sampler: S)

Implementors§

Source§

impl Source for Reporter

Source§

impl<'a> Source for dyn ErasedSource + 'a

Source§

impl<'a> Source for dyn ErasedSource + Send + Sync + 'a

Source§

impl<'a, P: Props> Source for Metric<'a, P>

Source§

impl<F: Fn(&mut dyn ErasedSampler)> Source for FromFn<F>

Source§

impl<T: Source, U: Source> Source for And<T, U>

Source§

impl<T: Source, U: Source> Source for Or<T, U>