pub trait Pool: Send + Sync {
type Permit: Send;
type BuildPermit: Send;
// Required methods
fn acquire_or_reserve(
&self,
cancellation: &Cancellation,
) -> impl Future<Output = Result<Acquisition<Self::Permit, Self::BuildPermit>, Error>> + Send;
fn begin_close(&self);
fn stats(&self) -> Stats;
}Expand description
Shared vocabulary with distinct associated acquisition types. Resource-specific mutation and use completion stay on the concrete types.
Required Associated Types§
Required Methods§
fn acquire_or_reserve( &self, cancellation: &Cancellation, ) -> impl Future<Output = Result<Acquisition<Self::Permit, Self::BuildPermit>, Error>> + Send
fn begin_close(&self)
fn stats(&self) -> Stats
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".