Struct sqlx::any::AnyConnectOptions
source · [−]pub struct AnyConnectOptions(_);
Expand description
Opaque options for connecting to a database. These may only be constructed by parsing from a connection uri.
postgres://postgres:password@localhost/database
mysql://root:password@localhost/database
Implementations
sourceimpl AnyConnectOptions
impl AnyConnectOptions
pub fn as_postgres(&self) -> Option<&PgConnectOptions>
pub fn as_postgres_mut(&mut self) -> Option<&mut PgConnectOptions>
sourceimpl AnyConnectOptions
impl AnyConnectOptions
pub fn as_mysql(&self) -> Option<&MySqlConnectOptions>
pub fn as_mysql_mut(&mut self) -> Option<&mut MySqlConnectOptions>
sourceimpl AnyConnectOptions
impl AnyConnectOptions
pub fn as_sqlite(&self) -> Option<&SqliteConnectOptions>
pub fn as_sqlite_mut(&mut self) -> Option<&mut SqliteConnectOptions>
sourceimpl AnyConnectOptions
impl AnyConnectOptions
pub fn as_mssql(&self) -> Option<&MssqlConnectOptions>
pub fn as_mssql_mut(&mut self) -> Option<&mut MssqlConnectOptions>
Trait Implementations
sourceimpl Clone for AnyConnectOptions
impl Clone for AnyConnectOptions
sourcefn clone(&self) -> AnyConnectOptions
fn clone(&self) -> AnyConnectOptions
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl ConnectOptions for AnyConnectOptions
impl ConnectOptions for AnyConnectOptions
type Connection = AnyConnection
sourcefn connect(
&self
) -> Pin<Box<dyn Future<Output = Result<AnyConnection, Error>> + Send, Global>>
fn connect(
&self
) -> Pin<Box<dyn Future<Output = Result<AnyConnection, Error>> + Send, Global>>
Establish a new database connection with the options specified by self
.
sourcefn log_statements(&mut self, level: LevelFilter) -> &mut AnyConnectOptions
fn log_statements(&mut self, level: LevelFilter) -> &mut AnyConnectOptions
Log executed statements with the specified level
sourcefn 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
. Read more
sourcefn disable_statement_logging(&mut self) -> &mut Self
fn disable_statement_logging(&mut self) -> &mut Self
Entirely disables statement logging (both slow and regular).
sourceimpl Debug for AnyConnectOptions
impl Debug for AnyConnectOptions
sourceimpl From<MssqlConnectOptions> for AnyConnectOptions
impl From<MssqlConnectOptions> for AnyConnectOptions
sourcefn from(options: MssqlConnectOptions) -> AnyConnectOptions
fn from(options: MssqlConnectOptions) -> AnyConnectOptions
Converts to this type from the input type.
sourceimpl From<MySqlConnectOptions> for AnyConnectOptions
impl From<MySqlConnectOptions> for AnyConnectOptions
sourcefn from(options: MySqlConnectOptions) -> AnyConnectOptions
fn from(options: MySqlConnectOptions) -> AnyConnectOptions
Converts to this type from the input type.
sourceimpl From<PgConnectOptions> for AnyConnectOptions
impl From<PgConnectOptions> for AnyConnectOptions
sourcefn from(options: PgConnectOptions) -> AnyConnectOptions
fn from(options: PgConnectOptions) -> AnyConnectOptions
Converts to this type from the input type.
sourceimpl From<SqliteConnectOptions> for AnyConnectOptions
impl From<SqliteConnectOptions> for AnyConnectOptions
sourcefn from(options: SqliteConnectOptions) -> AnyConnectOptions
fn from(options: SqliteConnectOptions) -> AnyConnectOptions
Converts to this type from the input type.
sourceimpl FromStr for AnyConnectOptions
impl FromStr for AnyConnectOptions
sourceimpl TryFrom<AnyConnectOptions> for MssqlConnectOptions
impl TryFrom<AnyConnectOptions> for MssqlConnectOptions
sourcefn 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.
sourceimpl TryFrom<AnyConnectOptions> for MySqlConnectOptions
impl TryFrom<AnyConnectOptions> for MySqlConnectOptions
sourcefn 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.
sourceimpl TryFrom<AnyConnectOptions> for PgConnectOptions
impl TryFrom<AnyConnectOptions> for PgConnectOptions
sourcefn 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.
sourceimpl TryFrom<AnyConnectOptions> for SqliteConnectOptions
impl TryFrom<AnyConnectOptions> for SqliteConnectOptions
sourcefn 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 !RefUnwindSafe for AnyConnectOptions
impl Send for AnyConnectOptions
impl Sync for AnyConnectOptions
impl Unpin for AnyConnectOptions
impl !UnwindSafe for AnyConnectOptions
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more