defer

Function defer 

Source
pub fn defer<F: FnOnce()>(f: F) -> Deferred<F>
Expand description

Run the given function when the returned value is dropped (unless it’s cancelled).