Fix self references in GenericClient
This commit is contained in:
parent
afc9b2835d
commit
1ea8b7b2d4
@ -507,7 +507,7 @@ impl Client {
|
||||
#[async_trait]
|
||||
impl GenericClient for Client {
|
||||
/// Like `Client::execute`.
|
||||
async fn execute<T>(&mut self, query: &T, params: &[&(dyn ToSql + Sync)]) -> Result<u64, Error>
|
||||
async fn execute<T>(&self, query: &T, params: &[&(dyn ToSql + Sync)]) -> Result<u64, Error>
|
||||
where
|
||||
T: ?Sized + ToStatement + Sync + Send,
|
||||
{
|
||||
@ -525,11 +525,7 @@ impl GenericClient for Client {
|
||||
}
|
||||
|
||||
/// Like `Client::query`.
|
||||
async fn query<T>(
|
||||
&mut self,
|
||||
query: &T,
|
||||
params: &[&(dyn ToSql + Sync)],
|
||||
) -> Result<Vec<Row>, Error>
|
||||
async fn query<T>(&self, query: &T, params: &[&(dyn ToSql + Sync)]) -> Result<Vec<Row>, Error>
|
||||
where
|
||||
T: ?Sized + ToStatement + Sync + Send,
|
||||
{
|
||||
@ -571,7 +567,7 @@ impl GenericClient for Client {
|
||||
}
|
||||
|
||||
/// Like `Client::prepare`.
|
||||
async fn prepare(&mut self, query: &str) -> Result<Statement, Error> {
|
||||
async fn prepare(&self, query: &str) -> Result<Statement, Error> {
|
||||
self.prepare(query).await
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@ use async_trait::async_trait;
|
||||
#[async_trait]
|
||||
pub trait GenericClient {
|
||||
/// Like `Client::execute`.
|
||||
async fn execute<T>(&mut self, query: &T, params: &[&(dyn ToSql + Sync)]) -> Result<u64, Error>
|
||||
async fn execute<T>(&self, query: &T, params: &[&(dyn ToSql + Sync)]) -> Result<u64, Error>
|
||||
where
|
||||
T: ?Sized + ToStatement + Sync + Send;
|
||||
|
||||
@ -19,11 +19,7 @@ pub trait GenericClient {
|
||||
I::IntoIter: ExactSizeIterator;
|
||||
|
||||
/// Like `Client::query`.
|
||||
async fn query<T>(
|
||||
&mut self,
|
||||
query: &T,
|
||||
params: &[&(dyn ToSql + Sync)],
|
||||
) -> Result<Vec<Row>, Error>
|
||||
async fn query<T>(&self, query: &T, params: &[&(dyn ToSql + Sync)]) -> Result<Vec<Row>, Error>
|
||||
where
|
||||
T: ?Sized + ToStatement + Sync + Send;
|
||||
|
||||
@ -53,7 +49,7 @@ pub trait GenericClient {
|
||||
I::IntoIter: ExactSizeIterator;
|
||||
|
||||
/// Like `Client::prepare`.
|
||||
async fn prepare(&mut self, query: &str) -> Result<Statement, Error>;
|
||||
async fn prepare(&self, query: &str) -> Result<Statement, Error>;
|
||||
|
||||
/// Like `Client::prepare_typed`.
|
||||
async fn prepare_typed(
|
||||
|
@ -290,7 +290,7 @@ impl<'a> Transaction<'a> {
|
||||
#[async_trait]
|
||||
impl crate::GenericClient for Transaction<'_> {
|
||||
/// Like `Transaction::execute`.
|
||||
async fn execute<T>(&mut self, query: &T, params: &[&(dyn ToSql + Sync)]) -> Result<u64, Error>
|
||||
async fn execute<T>(&self, query: &T, params: &[&(dyn ToSql + Sync)]) -> Result<u64, Error>
|
||||
where
|
||||
T: ?Sized + ToStatement + Sync + Send,
|
||||
{
|
||||
@ -308,11 +308,7 @@ impl crate::GenericClient for Transaction<'_> {
|
||||
}
|
||||
|
||||
/// Like `Transaction::query`.
|
||||
async fn query<T>(
|
||||
&mut self,
|
||||
query: &T,
|
||||
params: &[&(dyn ToSql + Sync)],
|
||||
) -> Result<Vec<Row>, Error>
|
||||
async fn query<T>(&self, query: &T, params: &[&(dyn ToSql + Sync)]) -> Result<Vec<Row>, Error>
|
||||
where
|
||||
T: ?Sized + ToStatement + Sync + Send,
|
||||
{
|
||||
@ -354,7 +350,7 @@ impl crate::GenericClient for Transaction<'_> {
|
||||
}
|
||||
|
||||
/// Like `Transaction::prepare`.
|
||||
async fn prepare(&mut self, query: &str) -> Result<Statement, Error> {
|
||||
async fn prepare(&self, query: &str) -> Result<Statement, Error> {
|
||||
self.prepare(query).await
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user