pub struct H2PoolRegistry { /* private fields */ }Expand description
Global H2 connection pool registry, keyed by (endpoint_host, endpoint_port, use_tls, server_name, auth_hash).
Implementations§
Source§impl H2PoolRegistry
impl H2PoolRegistry
pub fn new() -> Self
Sourcepub fn get_or_create(&self, key: &H2PoolKey) -> Arc<H2ConnectionPool> ⓘ
pub fn get_or_create(&self, key: &H2PoolKey) -> Arc<H2ConnectionPool> ⓘ
Get or create a pool for the given key.
Sourcepub fn prune_idle_pools(&self)
pub fn prune_idle_pools(&self)
Remove idle pools that are no longer referenced by an active stream.
Pruning acquires a write lock, so we skip the work when the registry is small. The threshold keeps contention bounded under H2 load.
Sourcepub fn with_defaults(
pool_size: u32,
idle_timeout: Duration,
max_concurrent_streams: u32,
) -> Self
pub fn with_defaults( pool_size: u32, idle_timeout: Duration, max_concurrent_streams: u32, ) -> Self
Configure default pool settings.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for H2PoolRegistry
impl RefUnwindSafe for H2PoolRegistry
impl Send for H2PoolRegistry
impl Sync for H2PoolRegistry
impl Unpin for H2PoolRegistry
impl UnsafeUnpin for H2PoolRegistry
impl UnwindSafe for H2PoolRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more