Struct mysql::conn::MyOpts [] [src]

pub struct MyOpts {
    pub tcp_addr: Option<String>,
    pub tcp_port: u16,
    pub unix_addr: Option<PathBuf>,
    pub user: Option<String>,
    pub pass: Option<String>,
    pub db_name: Option<String>,
    pub prefer_socket: bool,
    pub init: Vec<String>,
    pub verify_peer: bool,
    pub ssl_opts: Option<(PathBuf, Option<(PathBuf, PathBuf)>)>,
}

Mysql connection options.

For example:

let opts = MyOpts {
    user: Some("username".to_string()),
    pass: Some("password".to_string()),
    db_name: Some("mydatabase".to_string()),
    ..Default::default()
};

Fields

tcp_addr: Option<String>

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

tcp_port: u16

TCP port of mysql server (defaults to 3306).

unix_addr: Option<PathBuf>

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

user: Option<String>

User (defaults to None).

pass: Option<String>

Password (defaults to None).

db_name: Option<String>

Database name (defaults to None).

prefer_socket: bool

Prefer socket connection (defaults to true).

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

init: Vec<String>

Commands to execute on each new database connection.

verify_peer: 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.

ssl_opts: Option<(PathBuf, Option<(PathBuf, PathBuf)>)>

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 MyOpts
[src]

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

Formats the value using the given formatter.

impl PartialEq for MyOpts
[src]

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

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

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

This method tests for !=.

impl Eq for MyOpts
[src]

impl Clone for MyOpts
[src]

fn clone(&self) -> MyOpts

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 MyOpts
[src]

fn default() -> MyOpts

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