[][src]Struct reool::node_pool::Config

pub struct Config {
    pub desired_pool_size: usize,
    pub checkout_timeout: Option<Duration>,
    pub backoff_strategy: BackoffStrategy,
    pub reservation_limit: Option<usize>,
    pub stats_interval: Duration,
}

A configuration for creating a SingleNodePool.

You should prefer using the SingleNodePool::builder() function.

Fields

desired_pool_size: usize

The number of connections the pool should initially have and try to maintain

checkout_timeout: Option<Duration>

The timeout for a checkout if no specific tinmeout is given with a checkout.

backoff_strategy: BackoffStrategy

The BackoffStrategy to use when retrying on failures to create new connections

reservation_limit: Option<usize>

The maximum length of the queue for waiting checkouts when no idle connections are available

stats_interval: Duration

The interval in which the pool will send statistics to the instrumentation

Methods

impl Config[src]

pub fn desired_pool_size(self, v: usize) -> Self[src]

Sets the number of connections the pool should initially have and try to maintain

pub fn checkout_timeout(self, v: Option<Duration>) -> Self[src]

Sets the timeout for a checkout if no specific tinmeout is given with a checkout.

pub fn backoff_strategy(self, v: BackoffStrategy) -> Self[src]

Sets the BackoffStrategy to use when retrying on failures to create new connections

pub fn reservation_limit(self, v: Option<usize>) -> Self[src]

Sets the maximum length of the queue for waiting checkouts when no idle connections are available

pub fn stats_interval(self, v: Duration) -> Self[src]

The interval in which the pool will send statistics to the instrumentation

pub fn update_from_environment(
    self,
    prefix: Option<&str>
) -> Result<Self, InitializationError>
[src]

Updates this configuration from the environment.

If no prefix is set all the given env key start with REOOL_. Otherwise the prefix is used with an automatically appended _.

  • DESIRED_POOL_SIZE: usize. Omit if you do not want to update the value
  • CHECKOUT_TIMEOUT_MS: u64 or "NONE". Omit if you do not want to update the value
  • RESERVATION_LIMIT: usize or "NONE". Omit if you do not want to update the value
  • STATS_INTERVAL_MS: u64. Omit if you do not want to update the value

pub fn builder(&self) -> Builder<(), NoInstrumentation>[src]

Create a Builder initialized with the values from this Config

Trait Implementations

impl Default for Config[src]

Auto Trait Implementations

impl Send for Config

impl Sync for Config

Blanket Implementations

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

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

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.

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

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

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

impl<T> Erased for T