Struct mongodb::event::cmap::ConnectionPoolOptions[][src]

#[non_exhaustive]
pub struct ConnectionPoolOptions { pub max_idle_time: Option<Duration>, pub max_pool_size: Option<u32>, pub min_pool_size: Option<u32>, }
Expand description

Contains the options for creating a connection pool. While these options are specified at the client-level, ConnectionPoolOptions is exposed for the purpose of CMAP event handling.

Fields (Non-exhaustive)

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
max_idle_time: Option<Duration>

Connections that have been ready for usage in the pool for longer than max_idle_time will not be used.

The default is that connections will not be closed due to being idle.

max_pool_size: Option<u32>

The maximum number of connections that the pool can have at a given time. This includes connections which are currently checked out of the pool.

The default is 100.

min_pool_size: Option<u32>

The minimum number of connections that the pool can have at a given time. This includes connections which are currently checked out of the pool. If fewer than min_pool_size connections are in the pool, connections will be added to the pool in the background.

The default is that no minimum is enforced

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.