Struct mongo_driver::client::ClientPool
[−]
[src]
pub struct ClientPool { /* fields omitted */ }
Pool that allows usage of clients out of a single pool from multiple threads.
Use the pool to pop a client and do operations. The client will be automatically added back to the pool when it goes out of scope.
This client pool cannot be cloned, but it can be use from different threads by using an Arc
.
Clients cannot be shared between threads, pop a client from the pool for very single thread
where you need a connection.
Methods
impl ClientPool
[src]
pub fn new(uri: Uri, ssl_options: Option<SslOptions>) -> ClientPool
[src]
Create a new ClientPool with that can provide clients pointing to the specified uri.
The pool will connect via SSL if you add ?ssl=true
to the uri. You can optionally pass
in SSL options to configure SSL certificate usage and so on.
pub fn get_uri(&self) -> &Uri
[src]
Get a reference to this pool's Uri.
pub fn pop(&self) -> Client
[src]
Retrieve a client from the client pool, possibly blocking until one is available.
Trait Implementations
impl Send for ClientPool
[src]
impl Sync for ClientPool
[src]
impl Debug for ClientPool
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more