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]

fn new(host: Host) -> ConnectionPool

Returns a connection pool with a default size.

fn with_size(host: Host, size: usize) -> ConnectionPool

Returns a connection pool with a specified capped size.

fn set_size(&self, size: usize) -> Result<()>

Sets the maximum number of open connections.

fn clear(&self)

fn acquire_stream(&self) -> 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]

fn clone(&self) -> ConnectionPool

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more