pub struct ConnectionOptions<'a> { /* private fields */ }Expand description
Options used to establish connection to Mariadb/Mysql
Implementations§
Source§impl<'a> ConnectionOptions<'a>
impl<'a> ConnectionOptions<'a>
Sourcepub fn new() -> ConnectionOptions<'a>
pub fn new() -> ConnectionOptions<'a>
Construct new default connection options
Sourcepub fn into_owned(self) -> ConnectionOptions<'static>
pub fn into_owned(self) -> ConnectionOptions<'static>
Construct an owned copy of the options
Sourcepub fn from_url(url: &'a str) -> Result<Self, ConnectionError>
pub fn from_url(url: &'a str) -> Result<Self, ConnectionError>
Construct a connection options from a url
let o = ConnectionOptions::from_url(
"mysql://user:password@localhost/database?socket=/var/run/mysql.sock"
).unwrap();Sourcepub fn database(self, database: impl Into<Cow<'a, str>>) -> Self
pub fn database(self, database: impl Into<Cow<'a, str>>) -> Self
Set the database to connect to
Sourcepub fn address(self, address: impl ToSocketAddrs) -> Result<Self, Error>
pub fn address(self, address: impl ToSocketAddrs) -> Result<Self, Error>
The address to connect to
Sourcepub fn unix_socket(self, path: impl Into<Cow<'a, Path>>) -> Self
pub fn unix_socket(self, path: impl Into<Cow<'a, Path>>) -> Self
Set the unix socket to connect to
Sourcepub fn statment_case_size(self, size: usize) -> Self
pub fn statment_case_size(self, size: usize) -> Self
The maximum number of prepared statements in the cache
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ConnectionOptions<'a>
impl<'a> RefUnwindSafe for ConnectionOptions<'a>
impl<'a> Send for ConnectionOptions<'a>
impl<'a> Sync for ConnectionOptions<'a>
impl<'a> Unpin for ConnectionOptions<'a>
impl<'a> UnwindSafe for ConnectionOptions<'a>
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