Skip to main content

Cleanup

Type Alias Cleanup 

Source
pub type Cleanup = Box<dyn FnOnce() -> Result<()> + Send>;
Expand description

A cleanup function returned by a Connector implementation. Calling it detaches the device that was attached and releases any per-device resources.

Cleanup is callable exactly once; dropping it without calling typically also releases the device (each connector decides), but the explicit call is the contract used by serve.

Aliased Type§

pub struct Cleanup(/* private fields */);