SecureOperationExt

Trait SecureOperationExt 

Source
pub trait SecureOperationExt: Sized {
    type Output;

    // Required method
    fn execute_with_cleanup<F>(self, cleanup: F) -> Result<Self::Output, Error>
       where F: FnOnce();
}
Expand description

Extension trait for operations that produce a result

Required Associated Types§

Required Methods§

Source

fn execute_with_cleanup<F>(self, cleanup: F) -> Result<Self::Output, Error>
where F: FnOnce(),

Execute the operation and ensure cleanup on both success and failure

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§