Struct mysql::Opts

source ·
pub struct Opts { /* private fields */ }
Expand description

Mysql connection options.

Build one with OptsBuilder.

Implementations§

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 write to the server.

The timeout for each attempt to write to the server.

Prefer socket connection (defaults to true).

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

Will fall back to TCP on error. Use socket option to enforce socket connection.

Commands to execute on each new database connection.

Only available if ssl feature enabled.

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

Whether TCP_NODELAY will be set for mysql connection.

TCP keep alive time for mysql connection.

Callback to handle requests for local files.

Tcp connect timeout (defaults to None).

Bind address for a client (defaults to None).

Use carefully. Will probably make pool unusable because of address already in use errors.

Number of prepared statements cached on the client side (per connection). Defaults to 10.

If true, then client will ask for compression if server supports it (defaults to false).

Additional client capabilities to set (defaults to empty).

This value will be OR’ed with other client capabilities during connection initialisation.

Note

It is a good way to set something like CLIENT_FOUND_ROWS but you should note that it won’t let you to interfere with capabilities managed by other options (like CLIENT_SSL or CLIENT_COMPRESS). Also note that some capabilities are reserved, pointless or may broke the connection, so this option should be used with caution.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Converts to this type from the input type.
Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.