Struct atomic_cell::CleanGuard [] [src]

pub struct CleanGuard<'a> {
    // some fields omitted
}

A guard used to drop the value held by a CleanMeUp at a deterministic point in code. This is designed as an alternative to Drop for global variables.

Once the CleanGuard, the value held by the cell is also dropped.

Methods

impl<'a> CleanGuard<'a>

fn new(item: &'a CleanMeUp) -> Self

Create a new guard in charge of cleaning up an object.

Once the CleanGuard is dropped, the object's clean method is called.

Trait Implementations

impl<'a> Drop for CleanGuard<'a>

fn drop(&mut self)