Struct mysql::conn::Opts [] [src]

pub struct Opts {
    // some fields omitted
}

Mysql connection options.

Build one with OptsBuilder.

Methods

impl Opts
[src]

fn from_url(url: &str) -> Result<OptsUrlError>

fn get_ip_or_hostname(&self) -> &Option<String>

Address of mysql server (defaults to 127.0.0.1). Hostnames should also work.

fn get_tcp_port(&self) -> u16

TCP port of mysql server (defaults to 3306).

fn get_unix_addr(&self) -> &Option<PathBuf>

Path to unix socket of mysql server (defaults to None).

fn get_user(&self) -> &Option<String>

User (defaults to None).

fn get_pass(&self) -> &Option<String>

Password (defaults to None).

fn get_db_name(&self) -> &Option<String>

Database name (defaults to None).

fn get_read_timeout(&self) -> &Option<Duration>

The timeout for each attempt to write to the server.

fn get_write_timeout(&self) -> &Option<Duration>

The timeout for each attempt to write to the server.

fn get_prefer_socket(&self) -> bool

Prefer socket connection (defaults to true).

Will reconnect via socket after TCP connection to 127.0.0.1 if true.

fn get_init(&self) -> &Vec<String>

Commands to execute on each new database connection.

fn get_verify_peer(&self) -> bool

Only available if ssl feature enabled.

Perform or not ssl peer verification (defaults to false). Only make sense if ssl_opts is not None.

fn get_ssl_opts(&self) -> &SslOpts

Only available if ssl feature enabled.

SSL certificates and keys in pem format. If not None, then ssl connection implied.

Option<(ca_cert, Option<(client_cert, client_key)>)>.

Trait Implementations

impl Debug for Opts
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl PartialEq for Opts
[src]

fn eq(&self, __arg_0: &Opts) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &Opts) -> bool

This method tests for !=.

impl Eq for Opts
[src]

impl Clone for Opts
[src]

fn clone(&self) -> Opts

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

impl Default for Opts
[src]

fn default() -> Opts

Returns the "default value" for a type. Read more

impl From<OptsBuilder> for Opts
[src]

fn from(builder: OptsBuilder) -> Opts

Performs the conversion.

impl<'a> From<&'a str> for Opts
[src]

fn from(url: &'a str) -> Opts

Performs the conversion.