pub struct Pool { /* private fields */ }Expand description
Connection pool that limits concurrent requests.
The pool does not manage actual TCP connections; hyper handles that. It only enforces concurrency limits via semaphores.
§Example
use eggfetch_core::pool::{Pool, PoolConfig};
let pool = Pool::new(PoolConfig {
max_connections: Some(100),
max_connections_per_host: Some(10),
..Default::default()
});Implementations§
Source§impl Pool
impl Pool
Sourcepub fn new(config: PoolConfig) -> Self
pub fn new(config: PoolConfig) -> Self
Create a new pool from the given configuration.
Sourcepub fn metrics(&self) -> &PoolMetrics
pub fn metrics(&self) -> &PoolMetrics
Returns a reference to the pool metrics.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Pool
impl RefUnwindSafe for Pool
impl Send for Pool
impl Sync for Pool
impl Unpin for Pool
impl UnsafeUnpin for Pool
impl UnwindSafe for Pool
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