pub trait MetricCollector: Send + Sync {
// Required methods
fn collect(&self) -> DeviceResult<Vec<Metric>>;
fn name(&self) -> &str;
fn interval(&self) -> Duration;
fn is_enabled(&self) -> bool;
}Expand description
Metric collector trait
Required Methods§
Sourcefn collect(&self) -> DeviceResult<Vec<Metric>>
fn collect(&self) -> DeviceResult<Vec<Metric>>
Collect metrics
Sourcefn is_enabled(&self) -> bool
fn is_enabled(&self) -> bool
Check if collector is enabled
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".