Type Alias deadpool_redis::sentinel::Hook
source · pub type Hook = Hook<Manager>;
Expand description
Type alias for using deadpool::managed::Hook
with [redis_sentinel
].
Aliased Type§
enum Hook {
Fn(Box<dyn Fn(&mut MultiplexedConnection, &Metrics) -> Result<(), HookError<RedisError>> + Send + Sync>),
AsyncFn(Box<dyn for<'a> Fn(&'a mut MultiplexedConnection, &'a Metrics) -> Pin<Box<dyn Future<Output = Result<(), HookError<RedisError>>> + Send + 'a>> + Send + Sync>),
}
Variants§
Fn(Box<dyn Fn(&mut MultiplexedConnection, &Metrics) -> Result<(), HookError<RedisError>> + Send + Sync>)
Use a plain function (non-async) as a hook
AsyncFn(Box<dyn for<'a> Fn(&'a mut MultiplexedConnection, &'a Metrics) -> Pin<Box<dyn Future<Output = Result<(), HookError<RedisError>>> + Send + 'a>> + Send + Sync>)
Use an async function as a hook