pub trait ResourcePool<T>: Send + Sync {
// Required methods
fn acquire<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = MapReduceResult<ResourceGuard<T>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn release(&self, resource: T);
fn metrics(&self) -> PoolMetrics;
fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Trait for resource pools
Required Methods§
Sourcefn acquire<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = MapReduceResult<ResourceGuard<T>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn acquire<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = MapReduceResult<ResourceGuard<T>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Acquire a resource from the pool
Sourcefn metrics(&self) -> PoolMetrics
fn metrics(&self) -> PoolMetrics
Get pool metrics
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".