pub struct XuguConnectOptions { /* private fields */ }Implementations§
Source§impl XuguConnectOptions
impl XuguConnectOptions
pub fn get_version(&self) -> i16
Source§impl XuguConnectOptions
impl XuguConnectOptions
Sourcepub fn host(self, host: &str) -> Self
pub fn host(self, host: &str) -> Self
Sets the name of the host to connect to.
The default behavior when the host is not specified, is to connect to localhost.
Sourcepub fn port(self, port: u16) -> Self
pub fn port(self, port: u16) -> Self
Sets the port to connect to at the server host.
The default port for MySQL is 3306.
pub fn return_schema(self, value: bool) -> Self
pub fn return_rowid(self, value: bool) -> Self
pub fn encryptor(self, value: &str) -> Self
pub fn iso_level(self, value: &str) -> Self
pub fn lock_timeout(self, value: &str) -> Self
pub fn lob_ret(self, value: &str) -> Self
pub fn identity_mode(self, value: &str) -> Self
pub fn keyword_filter(self, value: &str) -> Self
pub fn disable_binlog(self, value: &str) -> Self
pub fn auto_commit(self, value: bool) -> Self
pub fn use_ssl(self, value: bool) -> Self
pub fn current_schema(self, value: &str) -> Self
pub fn compatible_mode(self, value: &str) -> Self
Sourcepub fn charset(self, charset: &str) -> Self
pub fn charset(self, charset: &str) -> Self
Sets the character set for the connection.
The default character set is utf8mb4. This is supported from MySQL 5.5.3.
If you need to connect to an older version, we recommend you to change this to utf8.
Implies [.set_names(true)][Self::set_names()].
Sourcepub fn timezone(self, value: impl Into<Option<String>>) -> Self
pub fn timezone(self, value: impl Into<Option<String>>) -> Self
If Some, sets the time_zone option to the given string after connecting to the database.
If None, no time_zone parameter is sent; the server timezone will be used instead.
Defaults to Some(String::from("+00:00")) to ensure all timestamps are in UTC.
§Warning
Changing this setting from its default will apply an unexpected skew to any
time::OffsetDateTime or chrono::DateTime<Utc> value, whether passed as a parameter or
decoded as a result. TIMESTAMP values are not encoded with their UTC offset in the MySQL
protocol, so encoding and decoding of these types assumes the server timezone is always
UTC.
If you are changing this option, ensure your application only uses
time::PrimitiveDateTime or chrono::NaiveDateTime and that it does not assume these
timestamps can be placed on a real timeline without applying the proper offset.
Source§impl XuguConnectOptions
impl XuguConnectOptions
Sourcepub fn get_host(&self) -> &str
pub fn get_host(&self) -> &str
Get the current host.
§Example
let options = XuguConnectOptions::new()
.host("127.0.0.1");
assert_eq!(options.get_host(), "127.0.0.1");Sourcepub fn get_port(&self) -> u16
pub fn get_port(&self) -> u16
Get the server’s port.
§Example
let options = XuguConnectOptions::new()
.port(5138);
assert_eq!(options.get_port(), 5138);Sourcepub fn get_user(&self) -> &str
pub fn get_user(&self) -> &str
Get the current user.
§Example
let options = XuguConnectOptions::new()
.user("foo");
assert_eq!(options.get_user(), "foo");Sourcepub fn get_database(&self) -> &str
pub fn get_database(&self) -> &str
Get the current database name.
§Example
let options = XuguConnectOptions::new()
.database("SYSTEM");
assert_eq!(options.get_database(), "SYSTEM");Sourcepub fn get_charset(&self) -> &str
pub fn get_charset(&self) -> &str
Get the server charset.
§Example
let options = XuguConnectOptions::new();
assert_eq!(options.get_charset(), "utf8");Trait Implementations§
Source§impl Clone for XuguConnectOptions
impl Clone for XuguConnectOptions
Source§fn clone(&self) -> XuguConnectOptions
fn clone(&self) -> XuguConnectOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ConnectOptions for XuguConnectOptions
impl ConnectOptions for XuguConnectOptions
type Connection = XuguConnection
Source§fn to_url_lossy(&self) -> Url
fn to_url_lossy(&self) -> Url
ConnectOptions. Read moreSource§fn connect(&self) -> BoxFuture<'_, Result<Self::Connection, Error>>where
Self::Connection: Sized,
fn connect(&self) -> BoxFuture<'_, Result<Self::Connection, Error>>where
Self::Connection: Sized,
self.Source§fn log_statements(self, level: LevelFilter) -> Self
fn log_statements(self, level: LevelFilter) -> Self
levelSource§fn log_slow_statements(self, level: LevelFilter, duration: Duration) -> Self
fn log_slow_statements(self, level: LevelFilter, duration: Duration) -> Self
duration
at the specified level.Source§fn disable_statement_logging(self) -> Self
fn disable_statement_logging(self) -> Self
Source§impl Debug for XuguConnectOptions
impl Debug for XuguConnectOptions
Source§impl Default for XuguConnectOptions
impl Default for XuguConnectOptions
Auto Trait Implementations§
impl Freeze for XuguConnectOptions
impl RefUnwindSafe for XuguConnectOptions
impl Send for XuguConnectOptions
impl Sync for XuguConnectOptions
impl Unpin for XuguConnectOptions
impl UnwindSafe for XuguConnectOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more