pub struct AnyConnectOptions(/* private fields */);Available on (crate features
postgres or mysql or mssql or sqlite or odbc) and crate feature any only.Expand description
Opaque options for connecting to a database. These may only be constructed by parsing from a connection url.
postgres://postgres:password@localhost/database
mysql://root:password@localhost/databaseImplementations§
Source§impl AnyConnectOptions
impl AnyConnectOptions
pub fn as_postgres(&self) -> Option<&PgConnectOptions>
pub fn as_postgres_mut(&mut self) -> Option<&mut PgConnectOptions>
Source§impl AnyConnectOptions
impl AnyConnectOptions
pub fn as_mysql(&self) -> Option<&MySqlConnectOptions>
pub fn as_mysql_mut(&mut self) -> Option<&mut MySqlConnectOptions>
Source§impl AnyConnectOptions
impl AnyConnectOptions
pub fn as_sqlite(&self) -> Option<&SqliteConnectOptions>
pub fn as_sqlite_mut(&mut self) -> Option<&mut SqliteConnectOptions>
Source§impl AnyConnectOptions
impl AnyConnectOptions
pub fn as_mssql(&self) -> Option<&MssqlConnectOptions>
pub fn as_mssql_mut(&mut self) -> Option<&mut MssqlConnectOptions>
Source§impl AnyConnectOptions
impl AnyConnectOptions
pub fn as_odbc(&self) -> Option<&OdbcConnectOptions>
pub fn as_odbc_mut(&mut self) -> Option<&mut OdbcConnectOptions>
Trait Implementations§
Source§impl Clone for AnyConnectOptions
impl Clone for AnyConnectOptions
Source§fn clone(&self) -> AnyConnectOptions
fn clone(&self) -> AnyConnectOptions
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 ConnectOptions for AnyConnectOptions
impl ConnectOptions for AnyConnectOptions
type Connection = AnyConnection
Source§fn connect(&self) -> BoxFuture<'_, Result<AnyConnection, Error>>
fn connect(&self) -> BoxFuture<'_, Result<AnyConnection, Error>>
Establish a new database connection with the options specified by
self.Source§fn log_statements(&mut self, level: LevelFilter) -> &mut Self
fn log_statements(&mut self, level: LevelFilter) -> &mut Self
Log executed statements with the specified
levelSource§fn log_slow_statements(
&mut self,
level: LevelFilter,
duration: Duration,
) -> &mut Self
fn log_slow_statements( &mut self, level: LevelFilter, duration: Duration, ) -> &mut Self
Log executed statements with a duration above the specified
duration
at the specified level.Source§fn disable_statement_logging(&mut self) -> &mut Self
fn disable_statement_logging(&mut self) -> &mut Self
Entirely disables statement logging (both slow and regular).
Source§impl Debug for AnyConnectOptions
impl Debug for AnyConnectOptions
Source§impl From<MssqlConnectOptions> for AnyConnectOptions
Available on crate feature mssql only.
impl From<MssqlConnectOptions> for AnyConnectOptions
Available on crate feature
mssql only.Source§fn from(options: MssqlConnectOptions) -> Self
fn from(options: MssqlConnectOptions) -> Self
Converts to this type from the input type.
Source§impl From<MySqlConnectOptions> for AnyConnectOptions
Available on crate feature mysql only.
impl From<MySqlConnectOptions> for AnyConnectOptions
Available on crate feature
mysql only.Source§fn from(options: MySqlConnectOptions) -> Self
fn from(options: MySqlConnectOptions) -> Self
Converts to this type from the input type.
Source§impl From<OdbcConnectOptions> for AnyConnectOptions
Available on crate feature odbc only.
impl From<OdbcConnectOptions> for AnyConnectOptions
Available on crate feature
odbc only.Source§fn from(options: OdbcConnectOptions) -> Self
fn from(options: OdbcConnectOptions) -> Self
Converts to this type from the input type.
Source§impl From<PgConnectOptions> for AnyConnectOptions
Available on crate feature postgres only.
impl From<PgConnectOptions> for AnyConnectOptions
Available on crate feature
postgres only.Source§fn from(options: PgConnectOptions) -> Self
fn from(options: PgConnectOptions) -> Self
Converts to this type from the input type.
Source§impl From<SqliteConnectOptions> for AnyConnectOptions
Available on crate feature sqlite only.
impl From<SqliteConnectOptions> for AnyConnectOptions
Available on crate feature
sqlite only.Source§fn from(options: SqliteConnectOptions) -> Self
fn from(options: SqliteConnectOptions) -> Self
Converts to this type from the input type.
Source§impl FromStr for AnyConnectOptions
impl FromStr for AnyConnectOptions
Source§impl TryFrom<AnyConnectOptions> for PgConnectOptions
impl TryFrom<AnyConnectOptions> for PgConnectOptions
Auto Trait Implementations§
impl Freeze for AnyConnectOptions
impl !RefUnwindSafe for AnyConnectOptions
impl Send for AnyConnectOptions
impl Sync for AnyConnectOptions
impl Unpin for AnyConnectOptions
impl !UnwindSafe for AnyConnectOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
Converts
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> ⓘ
Converts
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