pub trait QueryExecutor: Sized {
// Required methods
fn query<R, A>(
self,
query: impl AsRef<str> + Send,
arguments: &A,
) -> impl Future<Output = Result<Vec<R>, Error>> + Send
where A: QueryArgs,
R: QueryResult + Send;
fn query_verbose<R, A>(
self,
query: impl AsRef<str> + Send,
arguments: &A,
) -> impl Future<Output = Result<ResultVerbose<Vec<R>>, Error>> + Send
where A: QueryArgs,
R: QueryResult + Send;
fn query_single<R, A>(
self,
query: impl AsRef<str> + Send,
arguments: &A,
) -> impl Future<Output = Result<Option<R>, Error>> + Send
where A: QueryArgs,
R: QueryResult + Send;
fn query_required_single<R, A>(
self,
query: impl AsRef<str> + Send,
arguments: &A,
) -> impl Future<Output = Result<R, Error>> + Send
where A: QueryArgs,
R: QueryResult + Send;
fn query_json(
self,
query: &str,
arguments: &impl QueryArgs,
) -> impl Future<Output = Result<Json, Error>> + Send;
fn query_single_json(
self,
query: &str,
arguments: &impl QueryArgs,
) -> impl Future<Output = Result<Option<Json>, Error>> + Send;
fn query_required_single_json(
self,
query: &str,
arguments: &impl QueryArgs,
) -> impl Future<Output = Result<Json, Error>>;
fn execute<A>(
self,
query: &str,
arguments: &A,
) -> impl Future<Output = Result<(), Error>> + Send
where A: QueryArgs;
}Expand description
Abstracts over different query executors In particular &Client and &mut Transaction
Required Methods§
Sourcefn query<R, A>(
self,
query: impl AsRef<str> + Send,
arguments: &A,
) -> impl Future<Output = Result<Vec<R>, Error>> + Send
fn query<R, A>( self, query: impl AsRef<str> + Send, arguments: &A, ) -> impl Future<Output = Result<Vec<R>, Error>> + Send
see Client::query
Sourcefn query_verbose<R, A>(
self,
query: impl AsRef<str> + Send,
arguments: &A,
) -> impl Future<Output = Result<ResultVerbose<Vec<R>>, Error>> + Send
fn query_verbose<R, A>( self, query: impl AsRef<str> + Send, arguments: &A, ) -> impl Future<Output = Result<ResultVerbose<Vec<R>>, Error>> + Send
Sourcefn query_single<R, A>(
self,
query: impl AsRef<str> + Send,
arguments: &A,
) -> impl Future<Output = Result<Option<R>, Error>> + Send
fn query_single<R, A>( self, query: impl AsRef<str> + Send, arguments: &A, ) -> impl Future<Output = Result<Option<R>, Error>> + Send
Sourcefn query_required_single<R, A>(
self,
query: impl AsRef<str> + Send,
arguments: &A,
) -> impl Future<Output = Result<R, Error>> + Send
fn query_required_single<R, A>( self, query: impl AsRef<str> + Send, arguments: &A, ) -> impl Future<Output = Result<R, Error>> + Send
Sourcefn query_json(
self,
query: &str,
arguments: &impl QueryArgs,
) -> impl Future<Output = Result<Json, Error>> + Send
fn query_json( self, query: &str, arguments: &impl QueryArgs, ) -> impl Future<Output = Result<Json, Error>> + Send
Sourcefn query_single_json(
self,
query: &str,
arguments: &impl QueryArgs,
) -> impl Future<Output = Result<Option<Json>, Error>> + Send
fn query_single_json( self, query: &str, arguments: &impl QueryArgs, ) -> impl Future<Output = Result<Option<Json>, Error>> + Send
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.