deadpool_sqlite

Type Alias Hook

Source
pub type Hook = Hook<Manager>;
Expand description

Type alias for using deadpool::managed::Hook with rusqlite.

Aliased Type§

enum Hook {
    Fn(Box<dyn Fn(&mut SyncWrapper<Connection>, &Metrics) -> Result<(), HookError<Error>> + Send + Sync>),
    AsyncFn(Box<dyn for<'a> Fn(&'a mut SyncWrapper<Connection>, &'a Metrics) -> Pin<Box<dyn Future<Output = Result<(), HookError<Error>>> + Send + 'a>> + Send + Sync>),
}

Variants§

§

Fn(Box<dyn Fn(&mut SyncWrapper<Connection>, &Metrics) -> Result<(), HookError<Error>> + Send + Sync>)

Use a plain function (non-async) as a hook

§

AsyncFn(Box<dyn for<'a> Fn(&'a mut SyncWrapper<Connection>, &'a Metrics) -> Pin<Box<dyn Future<Output = Result<(), HookError<Error>>> + Send + 'a>> + Send + Sync>)

Use an async function as a hook