Struct deadpool_redis::PoolConfig[][src]

pub struct PoolConfig {
    pub max_size: usize,
    pub timeouts: Timeouts,
}

Re-export deadpool::managed::PoolConfig Pool configuration

Fields

max_size: usize

Maximum size of the pool

timeouts: Timeouts

Timeouts

Implementations

impl PoolConfig[src]

Re-export deadpool::managed::PoolConfig

pub fn new(max_size: usize) -> PoolConfig[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]

impl Debug for PoolConfig[src]

impl Default for PoolConfig[src]

pub fn default() -> PoolConfig[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]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.