Struct mysql::Opts [] [src]

pub struct Opts {
    // some fields omitted
}

Mysql connection options.

Build one with OptsBuilder.

Methods

impl Opts

fn from_url(url: &str) -> Result<Opts, UrlError>

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_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_init(&self) -> &Vec<String>

Commands to execute on each new database connection.

Trait Implementations

impl Default for Opts

fn default() -> Opts

impl From<OptsBuilder> for Opts

fn from(builder: OptsBuilder) -> Opts

impl<'a> From<&'a str> for Opts

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

Derived Implementations

impl Debug for Opts

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

impl PartialEq for Opts

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

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

impl Eq for Opts

impl Clone for Opts

fn clone(&self) -> Opts

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