pub struct AutoExportingMetrics<Message: MetricMessage> { /* private fields */ }
Expand description
A wrapper around a Message class that adds periodic backup.
At the specified interval and (best efforts) program exit, the current message will be exported to the given channel and reset with the message Default.
Implementations§
Source§impl<Message: MetricMessage> AutoExportingMetrics<Message>
impl<Message: MetricMessage> AutoExportingMetrics<Message>
Sourcepub fn lock(&self) -> MutexGuard<'_, Message>
pub fn lock(&self) -> MutexGuard<'_, Message>
Get a writeable guard holding the message that will next be exported Rather than using this directly the increment macro can be used
Trait Implementations§
Source§impl<Message: MetricMessage> Clone for AutoExportingMetrics<Message>
impl<Message: MetricMessage> Clone for AutoExportingMetrics<Message>
Source§impl<M: MetricMessage> Drop for AutoExportingMetrics<M>
impl<M: MetricMessage> Drop for AutoExportingMetrics<M>
Auto Trait Implementations§
impl<Message> Freeze for AutoExportingMetrics<Message>
impl<Message> !RefUnwindSafe for AutoExportingMetrics<Message>
impl<Message> Send for AutoExportingMetrics<Message>
impl<Message> Sync for AutoExportingMetrics<Message>
impl<Message> Unpin for AutoExportingMetrics<Message>
impl<Message> !UnwindSafe for AutoExportingMetrics<Message>
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