pub struct SimpleMetricBuilder<T, H> { /* private fields */ }Expand description
A Metric Builder to configure a metric to add to a SimpleMetricManager
Implementations§
Source§impl<T, H> SimpleMetricBuilder<T, H>
impl<T, H> SimpleMetricBuilder<T, H>
Sourcepub fn with_cmd_handler<F, Fut>(self, cb: F) -> Selfwhere
F: Fn(SimpleMetricManager<H>, SimpleManagerMetric<T, H>, Option<T>) -> Fut + Send + Sync + 'static,
Fut: Future<Output = ()> + Send + 'static,
pub fn with_cmd_handler<F, Fut>(self, cb: F) -> Selfwhere
F: Fn(SimpleMetricManager<H>, SimpleManagerMetric<T, H>, Option<T>) -> Fut + Send + Sync + 'static,
Fut: Future<Output = ()> + Send + 'static,
Set a handler which will be called when command messages for this metric are received.
The command handler is an async function that receives the manager, the metric, and an optional new value for the metric. If the value is “None” that indicates the CMD metric’s ‘is_null’ field was true
Auto Trait Implementations§
impl<T, H> Freeze for SimpleMetricBuilder<T, H>where
T: Freeze,
impl<T, H> !RefUnwindSafe for SimpleMetricBuilder<T, H>
impl<T, H> Send for SimpleMetricBuilder<T, H>where
T: Send,
impl<T, H> Sync for SimpleMetricBuilder<T, H>where
T: Sync,
impl<T, H> Unpin for SimpleMetricBuilder<T, H>where
T: Unpin,
impl<T, H> UnsafeUnpin for SimpleMetricBuilder<T, H>where
T: UnsafeUnpin,
impl<T, H> !UnwindSafe for SimpleMetricBuilder<T, H>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more