[−][src]Struct mongodb::event::cmap::ConnectionPoolOptions
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]
) -> TypedBuilder_BuilderFor_ConnectionPoolOptions<(), (), (), (), (), (), (), (), (), ()>
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]
fn clone(&self) -> ConnectionPoolOptions
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ConnectionPoolOptions
[src]
impl Default for ConnectionPoolOptions
[src]
fn default() -> ConnectionPoolOptions
[src]
impl<'de> Deserialize<'de> for ConnectionPoolOptions
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl PartialEq<ConnectionPoolOptions> for ConnectionPoolOptions
[src]
Auto Trait Implementations
impl !RefUnwindSafe for ConnectionPoolOptions
impl Send for ConnectionPoolOptions
impl Sync for ConnectionPoolOptions
impl Unpin for ConnectionPoolOptions
impl !UnwindSafe for ConnectionPoolOptions
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,