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§
Sourcefn sample_metrics<S: Sampler>(&self, sampler: S)
fn sample_metrics<S: Sampler>(&self, sampler: S)
Produce a current sample for all metrics in the source.
Provided Methods§
Sourcefn and_sample<U>(self, other: U) -> And<Self, U>where
Self: Sized,
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.
impl<'a, T: Source + ?Sized + 'a> Source for Box<T>
Available on crate feature
alloc only.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.
impl<'a, T: Source + ?Sized + 'a> Source for Arc<T>
Available on crate feature
alloc only.