Skip to main content

Pool

Struct Pool 

Source
pub struct Pool {
    pub per_host: usize,
    pub max_idle: usize,
    pub idle_ms: u32,
    /* private fields */
}
Expand description

connections kept open between requests (Client::with_pool): per origin, proxy and TLS layer, at most per_host of them and idle_ms long

Fields§

§per_host: usize§max_idle: usize§idle_ms: u32

Implementations§

Source§

impl Pool

Source

pub fn new() -> Arc<Pool> ⓘ

4 per host, 64 in all, 60 s

Source

pub fn with_limits(per_host: usize, max_idle: usize, idle_ms: u32) -> Arc<Pool> ⓘ

Source

pub fn idle(&self) -> usize

the connections waiting now

Source

pub fn clear(&self)

close them all

Auto Trait Implementations§

§

impl !Freeze for Pool

§

impl !RefUnwindSafe for Pool

§

impl !UnwindSafe for Pool

§

impl Forget for Pool

§

impl Move for Pool

§

impl Send for Pool
where Mutex<Vec<Idle>>: Send,

§

impl Sync for Pool
where Mutex<Vec<Idle>>: Sync,

§

impl Unpin for Pool
where Align4<u32>: Unpin, *const u8 is !null: Unpin, Box<dyn Stream>: Unpin, Arc<dyn Fn(&Url, TcpStream) -> Result<Box<dyn Stream>, HttpError> + Sync + Send>: Unpin,

§

impl UnsafeUnpin for Pool
where Align4<u32>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<Idle>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.