Struct mysql::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]

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

TCP port of mysql server (defaults to 3306).

Socket path on unix or pipe name on windows (defaults to None).

User (defaults to None).

Password (defaults to None).

Database name (defaults to None).

The timeout for each attempt to read from the server (defaults to None).

Note that named pipe connection will ignore duration's nanos, and also note that it is an error to pass the zero Duration to this method.

The timeout for each attempt to write to the server (defaults to None).

Note that named pipe connection will ignore duration's nanos, and also note that it is likely error to pass the zero Duration to this method.

TCP keep alive time for mysql connection (defaults to None). Available as tcp_keepalive_time_ms url parameter.

Prefer socket connection (defaults to true). Available as prefer_socket url parameter with value true or false.

Will reconnect via socket (on named pipe on windows) after TCP connection to 127.0.0.1 if true.

Commands to execute on each new database connection.

Only available if ssl feature enabled.

Perform or not ssl peer verification (defaults to false). Available as verify_peer url parameter with value true or false.

Only make sense if ssl_opts is not None.

Requires ssl feature

Callback to handle requests for local files. These are caused by using LOAD DATA LOCAL INFILE queries. The callback is passed the filename, and a Writeable object to receive the contents of that file. If unset, the default callback will read files relative to the current directory.

Tcp connect timeout (unix only, defaults to None). Available as tcp_connect_timeout_ms url parameter.

Trait Implementations

impl Default for OptsBuilder
[src]

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