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

pub struct ConnectionPoolOptions {
    pub app_name: Option<String>,
    pub connect_timeout: Option<Duration>,
    pub credential: Option<Credential>,
    pub driver_info: Option<DriverInfo>,
    pub event_handler: Option<Arc<dyn CmapEventHandler>>,
    pub max_idle_time: Option<Duration>,
    pub max_pool_size: Option<u32>,
    pub min_pool_size: Option<u32>,
    pub tls_options: Option<TlsOptions>,
    pub wait_queue_timeout: Option<Duration>,
}

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

app_name: Option<String>

The application name specified by the user. This is sent to the server as part of the handshake that each connection makes when it's created.

connect_timeout: Option<Duration>

The connect timeout passed to each underlying TcpStream when attemtping to connect to the server.

credential: Option<Credential>

The credential to use for authenticating connections in this pool.

driver_info: Option<DriverInfo>

Extra information to append to the driver version in the metadata of the handshake with the server. This should be used by libraries wrapping the driver, e.g. ODMs.

event_handler: Option<Arc<dyn CmapEventHandler>>

Processes all events generated by the pool.

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

tls_options: Option<TlsOptions>

The options specifying how a TLS connection should be configured. If tls_options is None, then TLS will not be used for the connections.

The default is not to use TLS for connections.

wait_queue_timeout: Option<Duration>

Rather than wait indefinitely for a connection to become available, instead return an error after the given duration.

The default is to block indefinitely until a connection becomes available.

Implementations

impl ConnectionPoolOptions[src]

pub fn builder(
) -> TypedBuilder_BuilderFor_ConnectionPoolOptions<(), (), (), (), (), (), (), (), (), ()>
[src]

Create a builder for building ConnectionPoolOptions. On the builder, call .app_name(...)(optional), .connect_timeout(...)(optional), .credential(...)(optional), .driver_info(...)(optional), .event_handler(...)(optional), .max_idle_time(...)(optional), .max_pool_size(...)(optional), .min_pool_size(...)(optional), .tls_options(...)(optional), .wait_queue_timeout(...)(optional) to set the values of the fields(they accept Into values). Finally, call .build() to create the instance of ConnectionPoolOptions.

Trait Implementations

impl Clone for ConnectionPoolOptions[src]

impl Debug for ConnectionPoolOptions[src]

impl Default for ConnectionPoolOptions[src]

impl<'de> Deserialize<'de> for ConnectionPoolOptions[src]

impl PartialEq<ConnectionPoolOptions> for ConnectionPoolOptions[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> Same<T> for T

type Output = T

Should always be Self

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,