Struct metrics::MetricsClientDestructor
pub struct MetricsClientDestructor(Box<dyn FnMut()>);
Expand description
Ensures any cleanup necessary is performed on drop. Can be used to ensure cleanup is done regardless of how the caller exits. Should be idempotent.
Tuple Fields§
§0: Box<dyn FnMut()>
Implementations§
§impl MetricsClientDestructor
impl MetricsClientDestructor
pub fn new<T>(cleanup: T) -> MetricsClientDestructorwhere
T: 'static + FnMut(),
pub fn cleanup(self)
pub fn cleanup(self)
A convenience method for immediately dropping self and invoking drop logic on the contained object.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for MetricsClientDestructor
impl !Send for MetricsClientDestructor
impl !Sync for MetricsClientDestructor
impl Unpin for MetricsClientDestructor
impl !UnwindSafe for MetricsClientDestructor
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