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>,
}

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

TCP address of mysql server (defaults to 127.0.0.1).

tcp_port

TCP port of mysql server (defaults to 3306).

unix_addr

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

user

User (defaults to None).

pass

Password (defaults to None).

db_name

Database name (defaults to None).

prefer_socket

Prefer socket connection (defaults to true).

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

init

Commands to execute on each new database connection.

Trait Implementations

impl Default for MyOpts

fn default() -> MyOpts

Derived Implementations

impl Debug for MyOpts

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

impl PartialEq for MyOpts

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

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

impl Eq for MyOpts

impl Clone for MyOpts

fn clone(&self) -> MyOpts

fn clone_from(&mut self, source: &Self)