pub trait AsPool {
// Required method
fn with_conn<'a, R, F>(
&'a self,
f: F,
) -> impl Future<Output = Result<R>> + Send + 'a
where F: FnOnce(&'a mut Connection) -> BoxFuture<'a, Result<R>> + Send + 'a,
R: Send + 'a;
}Expand description
Types from which a Connection can be borrowed for the duration of one
closure. The blanket impl GenericClient for &P builds on this.
Implemented on Pool and re-implementable by user wrappers (e.g. a
load-balanced multi-pool router).
Required Methods§
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.