Trait ConnectOptions

Source
pub trait ConnectOptions:
    'static
    + Send
    + Sync
    + FromStr<Err = Error>
    + Debug
    + Clone {
    type Connection: Connection + ?Sized;

    // Required methods
    fn connect(&self) -> BoxFuture<'_, Result<Self::Connection, Error>>
       where Self::Connection: Sized;
    fn log_statements(&mut self, level: LevelFilter) -> &mut Self;
    fn log_slow_statements(
        &mut self,
        level: LevelFilter,
        duration: Duration,
    ) -> &mut Self;

    // Provided method
    fn disable_statement_logging(&mut self) -> &mut Self { ... }
}

Required Associated Types§

Required Methods§

Source

fn connect(&self) -> BoxFuture<'_, Result<Self::Connection, Error>>
where Self::Connection: Sized,

Establish a new database connection with the options specified by self.

Source

fn log_statements(&mut self, level: LevelFilter) -> &mut Self

Log executed statements with the specified level

Source

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.

Provided Methods§

Source

fn disable_statement_logging(&mut self) -> &mut Self

Entirely disables statement logging (both slow and regular).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl ConnectOptions for AnyConnectOptions

Source§

impl ConnectOptions for MssqlConnectOptions

Available on crate feature mssql only.
Source§

impl ConnectOptions for MySqlConnectOptions

Available on crate feature mysql only.
Source§

impl ConnectOptions for PgConnectOptions

Available on crate feature postgres only.
Source§

impl ConnectOptions for SqliteConnectOptions

Available on crate feature sqlite only.