[−][src]Struct mysql_async::Opts
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_options(&self) -> &PoolOptions
[src]
Connection pool options (defaults to Default::default
).
pub fn get_conn_ttl(&self) -> Option<Duration>
[src]
Pool will close connection if time since last IO exceeds this number of seconds
(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
).
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
).
pub fn get_compression(&self) -> Option<Compression>
[src]
If not None
, then client will ask for compression if server supports it
(defaults to None
).
Can be defined using compress
connection url parameter with values:
fast
- for compression level 1;best
- for compression level 9;on
,true
- for default compression level;0
, ...,9
.
Note that compression level defined here will affect only outgoing packets.
Trait Implementations
impl From<OptsBuilder> for Opts
[src]
fn from(builder: OptsBuilder) -> Opts
[src]
impl<T: AsRef<str> + Sized> From<T> for Opts
[src]
impl Clone for Opts
[src]
impl Default for Opts
[src]
impl Eq for Opts
[src]
impl PartialEq<Opts> 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.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl StructuralPartialEq for Opts
[src]
impl StructuralEq for Opts
[src]
Auto Trait Implementations
impl Send for Opts
impl Sync for Opts
impl Unpin for Opts
impl !UnwindSafe for Opts
impl !RefUnwindSafe for Opts
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
fn vzip(self) -> V
impl<T> Same<T> for T
type Output = T
Should always be Self