Struct deadpool_redis::PoolConfig [−][src]
Expand description
Re-export deadpool::managed::PoolConfig Pool configuration
Fields
max_size: usize
Maximum size of the pool
timeouts: Timeouts
Timeouts
Implementations
impl PoolConfig
[src]
impl PoolConfig
[src]Re-export deadpool::managed::PoolConfig
pub fn new(max_size: usize) -> PoolConfig
[src]
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.
pub fn from_env(prefix: &str) -> Result<PoolConfig, ConfigError>
[src]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 Clone for PoolConfig
[src]pub fn clone(&self) -> PoolConfig
[src]
pub fn clone(&self) -> PoolConfig
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for PoolConfig
[src]
impl Debug for PoolConfig
[src]impl Default for PoolConfig
[src]
impl Default for PoolConfig
[src]pub fn default() -> 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]
impl<'de> Deserialize<'de> for PoolConfig
[src]pub fn deserialize<__D>(
__deserializer: __D
) -> Result<PoolConfig, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<PoolConfig, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for PoolConfig
impl Send for PoolConfig
impl Sync for PoolConfig
impl Unpin for PoolConfig
impl UnwindSafe for PoolConfig
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,