[−][src]Struct deadpool::managed::PoolConfig
Pool configuration
Fields
max_size: usize
Maximum size of the pool
timeouts: Timeouts
Timeouts
Implementations
impl PoolConfig
[src]
pub fn new(max_size: usize) -> Self
[src]
Create pool config without any timeouts
pub fn from_env(prefix: &str) -> Result<PoolConfig, ConfigError>
[src]
👎 Deprecated since 0.5.2:
Please embed this structure in your own config structure and use config::Config
directly.
Create pool config by reading it from the environment.
Example environment
POOL_MAX_SIZE = 1s
POOL_TIMEOUTS_WAIT = 1s
POOL_TIMEOUTS_CREATE = 1s
POOL_TIMEOUTS_RECYCLE = 1s
Example usage
ⓘ
Config::from_env("POOL")
Trait Implementations
impl Clone for PoolConfig
[src]
pub fn clone(&self) -> PoolConfig
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for PoolConfig
[src]
impl Default for PoolConfig
[src]
pub fn default() -> Self
[src]
Create pool with default config. The max_size
is set to
cpu_count * 4
ignoring any logical CPUs (Hyper-Threading).
impl<'de> Deserialize<'de> for PoolConfig
[src]
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl RefUnwindSafe for PoolConfig
[src]
impl Send for PoolConfig
[src]
impl Sync for PoolConfig
[src]
impl Unpin for PoolConfig
[src]
impl UnwindSafe for PoolConfig
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,