Struct PoolConfig

Source
pub struct PoolConfig<T: Send, E> { /* private fields */ }

Implementations§

Source§

impl<T: Send, E> PoolConfig<T, E>

Source

pub fn new<C, F>(create: C) -> Self
where C: Fn() -> F + Send + Sync + 'static, F: TryFuture<Ok = T, Error = E> + Send + 'static, T: Send + 'static, E: 'static,

Source

pub fn acquire_timeout(self, val: Duration) -> Self

Source

pub fn dispose<F>(self, dispose: F) -> Self
where F: Fn(T, ResourceInfo) + Send + Sync + 'static,

Source

pub fn handle_error<F>(self, handler: F) -> Self
where F: Fn(E) + Send + Sync + 'static,

Source

pub fn idle_timeout(self, val: Duration) -> Self

Source

pub fn verify<V, F>(self, verify: V) -> Self
where V: Fn(&mut T, ResourceInfo) -> F + Send + Sync + 'static, F: TryFuture<Ok = Option<T>, Error = E> + Send + 'static, T: Send + 'static, E: 'static,

Source

pub fn max_count(self, val: usize) -> Self

Source

pub fn max_waiters(self, val: usize) -> Self

Source

pub fn min_count(self, val: usize) -> Self

Source

pub fn release<F>(self, release: F) -> Self
where F: Fn(&mut T, ResourceInfo) -> bool + Send + Sync + 'static,

Source

pub fn build(self) -> Pool<T, E>

Auto Trait Implementations§

§

impl<T, E> Freeze for PoolConfig<T, E>

§

impl<T, E> !RefUnwindSafe for PoolConfig<T, E>

§

impl<T, E> Send for PoolConfig<T, E>

§

impl<T, E> Sync for PoolConfig<T, E>

§

impl<T, E> Unpin for PoolConfig<T, E>

§

impl<T, E> !UnwindSafe for PoolConfig<T, E>

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.