Struct mysql_async::OptsBuilder
[−]
[src]
pub struct OptsBuilder { /* fields omitted */ }Provides a way to build Opts.
// You can create new default builder let mut builder = OptsBuilder::new(); builder.ip_or_hostname(Some("foo")) .db_name(Some("bar")) .ssl_opts(Some(("/foo/cert.pem", None::<(String, String)>))); // Or use existing T: Into<Opts> let mut builder = OptsBuilder::from_opts(existing_opts); builder.ip_or_hostname(Some("foo")) .db_name(Some("bar"));
Methods
impl OptsBuilder[src]
pub fn new() -> Self[src]
pub fn from_opts<T: Into<Opts>>(opts: T) -> Self[src]
ⓘImportant traits for &'a mut Wpub fn ip_or_hostname<T: Into<String>>(
&mut self,
ip_or_hostname: T
) -> &mut Self[src]
&mut self,
ip_or_hostname: T
) -> &mut Self
Address of mysql server (defaults to 127.0.0.1). Hostnames should also work.
ⓘImportant traits for &'a mut Wpub fn tcp_port(&mut self, tcp_port: u16) -> &mut Self[src]
TCP port of mysql server (defaults to 3306).
ⓘImportant traits for &'a mut Wpub fn user<T: Into<String>>(&mut self, user: Option<T>) -> &mut Self[src]
User (defaults to None).
ⓘImportant traits for &'a mut Wpub fn pass<T: Into<String>>(&mut self, pass: Option<T>) -> &mut Self[src]
Password (defaults to None).
ⓘImportant traits for &'a mut Wpub fn db_name<T: Into<String>>(&mut self, db_name: Option<T>) -> &mut Self[src]
Database name (defaults to None).
ⓘImportant traits for &'a mut Wpub fn init<T: Into<String>>(&mut self, init: Vec<T>) -> &mut Self[src]
Commands to execute on each new database connection.
ⓘImportant traits for &'a mut Wpub fn tcp_keepalive<T: Into<u32>>(
&mut self,
tcp_keepalive: Option<T>
) -> &mut Self[src]
&mut self,
tcp_keepalive: Option<T>
) -> &mut Self
TCP keep alive timeout in milliseconds (defaults to None).
ⓘImportant traits for &'a mut Wpub fn tcp_nodelay(&mut self, nodelay: bool) -> &mut Self[src]
Set the TCP_NODELAY option for the mysql connection (defaults to true).
Setting this option to false re-enables Nagle's algorithm, which can cause unusually high latency (~40ms) but may increase maximum throughput. See #132.
ⓘImportant traits for &'a mut Wpub fn local_infile_handler<T>(&mut self, handler: Option<T>) -> &mut Self where
T: LocalInfileHandler + 'static, [src]
T: LocalInfileHandler + 'static,
Handler for local infile requests (defaults to None).
ⓘImportant traits for &'a mut Wpub fn pool_min<T: Into<usize>>(&mut self, pool_min: Option<T>) -> &mut Self[src]
Lower bound of opened connections for Pool
(defaults to 10. None to reset to default).
ⓘImportant traits for &'a mut Wpub fn pool_max<T: Into<usize>>(&mut self, pool_max: Option<T>) -> &mut Self[src]
Lower bound of opened connections for Pool
(defaults to 100. None to reset to default).
ⓘImportant traits for &'a mut Wpub fn conn_ttl<T: Into<u32>>(&mut self, conn_ttl: Option<T>) -> &mut Self[src]
Pool will close connection if time since last IO exceeds this value
(defaults to wait_timeout. None to reset to default).
ⓘImportant traits for &'a mut Wpub fn stmt_cache_size<T>(&mut self, cache_size: T) -> &mut Self where
T: Into<Option<usize>>, [src]
T: Into<Option<usize>>,
Number of prepared statements cached on the client side (per connection). Defaults to 10.
Call with None to reset to default.
ⓘImportant traits for &'a mut Wpub fn ssl_opts<T: Into<Option<SslOpts>>>(&mut self, ssl_opts: T) -> &mut Self[src]
Driver will require SSL connection if this option isn't None (default to None).
This option requires ssl feature to work.
Trait Implementations
impl Debug for OptsBuilder[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more
impl Clone for OptsBuilder[src]
fn clone(&self) -> OptsBuilder[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl Eq for OptsBuilder[src]
impl PartialEq for OptsBuilder[src]
fn eq(&self, __arg_0: &OptsBuilder) -> bool[src]
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &OptsBuilder) -> bool[src]
This method tests for !=.
impl Default for OptsBuilder[src]
fn default() -> OptsBuilder[src]
Returns the "default value" for a type. Read more
impl From<OptsBuilder> for Opts[src]
fn from(builder: OptsBuilder) -> Opts[src]
Performs the conversion.