Trait DeviceMetricManager

Source
pub trait DeviceMetricManager: MetricManager {
    // Provided methods
    fn init(&self, _handle: &DeviceHandle) { ... }
    fn on_dcmd<'life0, 'async_trait>(
        &'life0 self,
        _device: DeviceHandle,
        _metrics: MessageMetrics,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

A trait for implementing a type that defines device-specific metrics

Provided Methods§

Source

fn init(&self, _handle: &DeviceHandle)

Initialise the struct.

Called when the Device is created

Source

fn on_dcmd<'life0, 'async_trait>( &'life0 self, _device: DeviceHandle, _metrics: MessageMetrics, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Processes DCMD metrics.

This async method is called when a DCMD message for the device is received, allowing the implementation to handle command metrics as it sees fit. The default implementation does nothing.

Implementors§