pub struct MysqlConfig {
pub host: String,
pub port: u16,
pub user: String,
pub password: Option<String>,
pub database: Option<String>,
pub socket: Option<String>,
}Expand description
MySQL connection configuration parsed from CLI args or .my.cnf.
Fields§
§host: String§port: u16§user: String§password: Option<String>§database: Option<String>§socket: Option<String>Implementations§
Source§impl MysqlConfig
impl MysqlConfig
Sourcepub fn connection_url(&self) -> String
pub fn connection_url(&self) -> String
Build a mysql_async connection URL from the config.
Sourcepub fn to_opts(&self) -> OptsBuilder
pub fn to_opts(&self) -> OptsBuilder
Build an opts builder from config.
Trait Implementations§
Source§impl Clone for MysqlConfig
impl Clone for MysqlConfig
Source§fn clone(&self) -> MysqlConfig
fn clone(&self) -> MysqlConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MysqlConfig
impl Debug for MysqlConfig
Auto Trait Implementations§
impl Freeze for MysqlConfig
impl RefUnwindSafe for MysqlConfig
impl Send for MysqlConfig
impl Sync for MysqlConfig
impl Unpin for MysqlConfig
impl UnwindSafe for MysqlConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more