Struct mongodb::pool::ConnectionPool [−][src]
pub struct ConnectionPool {
pub host: Host,
// some fields omitted
}Handles threaded connections to a MongoDB server.
Fields
host: Host
The connection host.
Methods
impl ConnectionPool[src]
impl ConnectionPoolpub fn new(host: Host, connector: StreamConnector) -> ConnectionPool[src]
pub fn new(host: Host, connector: StreamConnector) -> ConnectionPoolReturns a connection pool with a default size.
pub fn with_size(
host: Host,
connector: StreamConnector,
size: usize
) -> ConnectionPool[src]
pub fn with_size(
host: Host,
connector: StreamConnector,
size: usize
) -> ConnectionPoolReturns a connection pool with a specified capped size.
pub fn set_size(&self, size: usize) -> Result<()>[src]
pub fn set_size(&self, size: usize) -> Result<()>Sets the maximum number of open connections.
pub fn clear(&self)[src]
pub fn clear(&self)pub fn acquire_stream(&self, client: Client) -> Result<PooledStream>[src]
pub fn acquire_stream(&self, client: Client) -> Result<PooledStream>Attempts to acquire a connected socket. If none are available and the pool has not reached its maximum size, a new socket will connect. Otherwise, the function will block until a socket is returned to the pool.
Trait Implementations
impl Clone for ConnectionPool[src]
impl Clone for ConnectionPoolfn clone(&self) -> ConnectionPool[src]
fn clone(&self) -> ConnectionPoolReturns 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
Auto Trait Implementations
impl Send for ConnectionPool
impl Send for ConnectionPoolimpl Sync for ConnectionPool
impl Sync for ConnectionPool