pub struct AnyConnectOptions(/* private fields */);
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/database
Implementationsยง
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>
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,
) -> Pin<Box<dyn Future<Output = Result<AnyConnection, Error>> + Send + '_>>
fn connect( &self, ) -> Pin<Box<dyn Future<Output = Result<AnyConnection, Error>> + Send + '_>>
Establish a new database connection with the options specified by
self
.Sourceยงfn log_statements(&mut self, level: LevelFilter) -> &mut AnyConnectOptions
fn log_statements(&mut self, level: LevelFilter) -> &mut AnyConnectOptions
Log executed statements with the specified
level
Sourceยงfn log_slow_statements(
&mut self,
level: LevelFilter,
duration: Duration,
) -> &mut AnyConnectOptions
fn log_slow_statements( &mut self, level: LevelFilter, duration: Duration, ) -> &mut AnyConnectOptions
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
impl From<MssqlConnectOptions> for AnyConnectOptions
Sourceยงfn from(options: MssqlConnectOptions) -> AnyConnectOptions
fn from(options: MssqlConnectOptions) -> AnyConnectOptions
Converts to this type from the input type.
Sourceยงimpl From<MySqlConnectOptions> for AnyConnectOptions
impl From<MySqlConnectOptions> for AnyConnectOptions
Sourceยงfn from(options: MySqlConnectOptions) -> AnyConnectOptions
fn from(options: MySqlConnectOptions) -> AnyConnectOptions
Converts to this type from the input type.
Sourceยงimpl From<PgConnectOptions> for AnyConnectOptions
impl From<PgConnectOptions> for AnyConnectOptions
Sourceยงfn from(options: PgConnectOptions) -> AnyConnectOptions
fn from(options: PgConnectOptions) -> AnyConnectOptions
Converts to this type from the input type.
Sourceยงimpl From<SqliteConnectOptions> for AnyConnectOptions
impl From<SqliteConnectOptions> for AnyConnectOptions
Sourceยงfn from(options: SqliteConnectOptions) -> AnyConnectOptions
fn from(options: SqliteConnectOptions) -> AnyConnectOptions
Converts to this type from the input type.
Sourceยงimpl FromStr for AnyConnectOptions
impl FromStr for AnyConnectOptions
Sourceยงimpl TryFrom<AnyConnectOptions> for MssqlConnectOptions
impl TryFrom<AnyConnectOptions> for MssqlConnectOptions
Sourceยงfn try_from(
value: AnyConnectOptions,
) -> Result<MssqlConnectOptions, <MssqlConnectOptions as TryFrom<AnyConnectOptions>>::Error>
fn try_from( value: AnyConnectOptions, ) -> Result<MssqlConnectOptions, <MssqlConnectOptions as TryFrom<AnyConnectOptions>>::Error>
Performs the conversion.
Sourceยงimpl TryFrom<AnyConnectOptions> for MySqlConnectOptions
impl TryFrom<AnyConnectOptions> for MySqlConnectOptions
Sourceยงfn try_from(
value: AnyConnectOptions,
) -> Result<MySqlConnectOptions, <MySqlConnectOptions as TryFrom<AnyConnectOptions>>::Error>
fn try_from( value: AnyConnectOptions, ) -> Result<MySqlConnectOptions, <MySqlConnectOptions as TryFrom<AnyConnectOptions>>::Error>
Performs the conversion.
Sourceยงimpl TryFrom<AnyConnectOptions> for PgConnectOptions
impl TryFrom<AnyConnectOptions> for PgConnectOptions
Sourceยงfn try_from(
value: AnyConnectOptions,
) -> Result<PgConnectOptions, <PgConnectOptions as TryFrom<AnyConnectOptions>>::Error>
fn try_from( value: AnyConnectOptions, ) -> Result<PgConnectOptions, <PgConnectOptions as TryFrom<AnyConnectOptions>>::Error>
Performs the conversion.
Sourceยงimpl TryFrom<AnyConnectOptions> for SqliteConnectOptions
impl TryFrom<AnyConnectOptions> for SqliteConnectOptions
Sourceยงfn try_from(
value: AnyConnectOptions,
) -> Result<SqliteConnectOptions, <SqliteConnectOptions as TryFrom<AnyConnectOptions>>::Error>
fn try_from( value: AnyConnectOptions, ) -> Result<SqliteConnectOptions, <SqliteConnectOptions as TryFrom<AnyConnectOptions>>::Error>
Performs the conversion.
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