pub trait Client: Send + Sync {
type Error: Error + Send + Sync + 'static;
type Row: Row;
// Required methods
fn query(
&self,
sql: &str,
params: &[&dyn ToSqlParam],
) -> impl Future<Output = Result<Vec<Self::Row>, Self::Error>> + Send;
fn execute(
&self,
sql: &str,
params: &[&dyn ToSqlParam],
) -> impl Future<Output = Result<u64, Self::Error>> + Send;
}Expand description
Trait for executing SQL queries against a database.
Uses impl Future instead of async_trait to avoid proc macro compile overhead.
Required Associated Types§
Required Methods§
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.