[][src]Struct mysql_async::Opts

pub struct Opts { /* fields omitted */ }

Mysql connection options.

Build one with OptsBuilder.

Methods

impl Opts[src]

pub fn from_url(url: &str) -> Result<Opts, UrlError>[src]

pub fn get_ip_or_hostname(&self) -> &str[src]

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

pub fn get_tcp_port(&self) -> u16[src]

TCP port of mysql server (defaults to 3306).

pub fn get_user(&self) -> Option<&str>[src]

User (defaults to None).

pub fn get_pass(&self) -> Option<&str>[src]

Password (defaults to None).

pub fn get_db_name(&self) -> Option<&str>[src]

Database name (defaults to None).

pub fn get_init(&self) -> &[String][src]

Commands to execute on each new database connection.

pub fn get_tcp_keepalive(&self) -> Option<u32>[src]

TCP keep alive timeout in milliseconds (defaults to `None).

pub fn get_tcp_nodelay(&self) -> bool[src]

Whether TCP_NODELAY will be set for mysql connection.

pub fn get_local_infile_handler(&self) -> Option<Arc<dyn LocalInfileHandler>>[src]

Local infile handler

pub fn get_pool_constraints(&self) -> &PoolConstraints[src]

/// Bounds for the number of opened connections in Pool (defaults to min: 10, max: 100).

pub fn get_conn_ttl(&self) -> Option<u32>[src]

Pool will close connection if time since last IO exceeds this value (defaults to wait_timeout).

pub fn get_stmt_cache_size(&self) -> usize[src]

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

pub fn get_ssl_opts(&self) -> Option<&SslOpts>[src]

Driver will require SSL connection if this option isn't None (default to None).

This option requires ssl feature to work.

pub fn get_perfer_socket(&self) -> bool[src]

Will prefer socket connection if true (defaults to true).

pub fn get_prefer_socket(&self) -> bool[src]

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.

Note

Library will query the @@socket server variable to get socket address, and this address may be incorrect in some cases (i.e. docker).

pub fn get_socket(&self) -> Option<&str>[src]

Socket path (defaults to None).

Trait Implementations

impl From<OptsBuilder> for Opts[src]

impl<T: AsRef<str> + Sized> From<T> for Opts[src]

impl Default for Opts[src]

impl Clone for Opts[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl PartialEq<Opts> for Opts[src]

impl Eq for Opts[src]

impl Debug for Opts[src]

impl FromStr for Opts[src]

type Err = UrlError

The associated error which can be returned from parsing.

Auto Trait Implementations

impl Unpin for Opts

impl Send for Opts

impl Sync for Opts

impl !RefUnwindSafe for Opts

impl !UnwindSafe for Opts

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Erased for T