pub trait AsyncConnection: AsyncExecute {
// Required methods
fn establish(
database_url: &str,
) -> impl Future<Output = ConnectionResult<Self>> + Send;
fn is_broken(&self) -> bool;
}Expand description
An async connection to a database
This trait represents an async database connection.
Required Methods§
Sourcefn establish(
database_url: &str,
) -> impl Future<Output = ConnectionResult<Self>> + Send
fn establish( database_url: &str, ) -> impl Future<Output = ConnectionResult<Self>> + Send
Establishes a new connection to the database
The argument to this method and the method’s behavior varies by backend. See the documentation for that backend’s connection class for details about what it accepts and how it behaves.
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§
impl AsyncConnection for AsyncMysqlConnection
Available on crate feature
mysql only.impl AsyncConnection for AsyncPgConnection
Available on crate feature
postgres only.