Struct mongod::ClientBuilder [−][src]
pub struct ClientBuilder { /* fields omitted */ }
Expand description
A ClientBuilder
can be used to create a Client
with custom configuration.
Implementations
Returns a Client
built from this ClientBuilder
configuration.
Errors
This method fails if the mongodb::Client
cannot be initialised.
Sets the username/password that should be used by this client.
Example
let _client = mongod::Client::builder() .auth("foo", Some("bar")) .build().unwrap();
Sets the CA file that should be used by this client for TLS.
Example
let _client = mongod::Client::builder() .ca("./certs/foo.pem") .build().unwrap();
Sets the certificate file that should be used by this client for identification.
Example
let _client = mongod::Client::builder() .cert_key("./certs/foo.pem") .build().unwrap();
Sets the database that should be used by this client.
Example
let _client = mongod::Client::builder() .database("foo") .build().unwrap();