pub trait GenericClient: Sync {
// Required methods
fn prepare(
&self,
query: &str,
) -> impl Future<Output = Result<Statement, Error>> + Send;
fn query<T>(
&self,
statement: &T,
params: &[&(dyn ToSql + Sync)],
) -> impl Future<Output = Result<Vec<Row>, Error>> + Send
where T: ?Sized + Query;
fn query_one<T>(
&self,
statement: &T,
params: &[&(dyn ToSql + Sync)],
) -> impl Future<Output = Result<Row, Error>> + Send
where T: ?Sized + Query;
fn query_opt<T>(
&self,
statement: &T,
params: &[&(dyn ToSql + Sync)],
) -> impl Future<Output = Result<Option<Row>, Error>> + Send
where T: ?Sized + Query;
fn execute<T>(
&self,
statement: &T,
params: &[&(dyn ToSql + Sync)],
) -> impl Future<Output = Result<u64, Error>> + Send
where T: ?Sized + Query;
fn batch_execute(
&self,
query: &str,
) -> impl Future<Output = Result<(), Error>> + Send;
}Expand description
The instrumented calls of a Client or a Transaction, for helpers
that take either. tokio-postgres’s own GenericClient is sealed.
Required Methods§
Sourcefn prepare(
&self,
query: &str,
) -> impl Future<Output = Result<Statement, Error>> + Send
fn prepare( &self, query: &str, ) -> impl Future<Output = Result<Statement, Error>> + Send
See Client::prepare.
Sourcefn query<T>(
&self,
statement: &T,
params: &[&(dyn ToSql + Sync)],
) -> impl Future<Output = Result<Vec<Row>, Error>> + Send
fn query<T>( &self, statement: &T, params: &[&(dyn ToSql + Sync)], ) -> impl Future<Output = Result<Vec<Row>, Error>> + Send
See Client::query.
Sourcefn query_one<T>(
&self,
statement: &T,
params: &[&(dyn ToSql + Sync)],
) -> impl Future<Output = Result<Row, Error>> + Send
fn query_one<T>( &self, statement: &T, params: &[&(dyn ToSql + Sync)], ) -> impl Future<Output = Result<Row, Error>> + Send
See Client::query_one.
Sourcefn query_opt<T>(
&self,
statement: &T,
params: &[&(dyn ToSql + Sync)],
) -> impl Future<Output = Result<Option<Row>, Error>> + Send
fn query_opt<T>( &self, statement: &T, params: &[&(dyn ToSql + Sync)], ) -> impl Future<Output = Result<Option<Row>, Error>> + Send
See Client::query_opt.
Sourcefn execute<T>(
&self,
statement: &T,
params: &[&(dyn ToSql + Sync)],
) -> impl Future<Output = Result<u64, Error>> + Send
fn execute<T>( &self, statement: &T, params: &[&(dyn ToSql + Sync)], ) -> impl Future<Output = Result<u64, Error>> + Send
See Client::execute.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".