Trait tokio_postgres::GenericClient
source · pub trait GenericClient: Sealed {
Show 14 methods
// Required methods
fn execute<'life0, 'life1, 'life2, 'life3, 'async_trait, T>(
&'life0 self,
query: &'life1 T,
params: &'life2 [&'life3 (dyn ToSql + Sync)],
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>
where T: ?Sized + ToStatement + Sync + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn execute_raw<'life0, 'life1, 'async_trait, P, I, T>(
&'life0 self,
statement: &'life1 T,
params: I,
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>
where T: ?Sized + ToStatement + Sync + Send + 'async_trait,
P: BorrowToSql + 'async_trait,
I: IntoIterator<Item = P> + Sync + Send + 'async_trait,
I::IntoIter: ExactSizeIterator,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn query<'life0, 'life1, 'life2, 'life3, 'async_trait, T>(
&'life0 self,
query: &'life1 T,
params: &'life2 [&'life3 (dyn ToSql + Sync)],
) -> Pin<Box<dyn Future<Output = Result<Vec<Row>, Error>> + Send + 'async_trait>>
where T: ?Sized + ToStatement + Sync + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn query_one<'life0, 'life1, 'life2, 'life3, 'async_trait, T>(
&'life0 self,
statement: &'life1 T,
params: &'life2 [&'life3 (dyn ToSql + Sync)],
) -> Pin<Box<dyn Future<Output = Result<Row, Error>> + Send + 'async_trait>>
where T: ?Sized + ToStatement + Sync + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn query_opt<'life0, 'life1, 'life2, 'life3, 'async_trait, T>(
&'life0 self,
statement: &'life1 T,
params: &'life2 [&'life3 (dyn ToSql + Sync)],
) -> Pin<Box<dyn Future<Output = Result<Option<Row>, Error>> + Send + 'async_trait>>
where T: ?Sized + ToStatement + Sync + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn query_raw<'life0, 'life1, 'async_trait, T, P, I>(
&'life0 self,
statement: &'life1 T,
params: I,
) -> Pin<Box<dyn Future<Output = Result<RowStream, Error>> + Send + 'async_trait>>
where T: ?Sized + ToStatement + Sync + Send + 'async_trait,
P: BorrowToSql + 'async_trait,
I: IntoIterator<Item = P> + Sync + Send + 'async_trait,
I::IntoIter: ExactSizeIterator,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn query_typed<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
statement: &'life1 str,
params: &'life2 [(&'life3 (dyn ToSql + Sync), Type)],
) -> Pin<Box<dyn Future<Output = Result<Vec<Row>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn query_typed_raw<'life0, 'life1, 'async_trait, P, I>(
&'life0 self,
statement: &'life1 str,
params: I,
) -> Pin<Box<dyn Future<Output = Result<RowStream, Error>> + Send + 'async_trait>>
where P: BorrowToSql + 'async_trait,
I: IntoIterator<Item = (P, Type)> + Sync + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn prepare<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Statement, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn prepare_typed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 str,
parameter_types: &'life2 [Type],
) -> Pin<Box<dyn Future<Output = Result<Statement, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn transaction<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Transaction<'_>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn batch_execute<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn simple_query<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<SimpleQueryMessage>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn client(&self) -> &Client;
}
Expand description
A trait allowing abstraction over connections and transactions.
This trait is “sealed”, and cannot be implemented outside of this crate.
Required Methods§
sourcefn execute<'life0, 'life1, 'life2, 'life3, 'async_trait, T>(
&'life0 self,
query: &'life1 T,
params: &'life2 [&'life3 (dyn ToSql + Sync)],
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>where
T: ?Sized + ToStatement + Sync + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn execute<'life0, 'life1, 'life2, 'life3, 'async_trait, T>(
&'life0 self,
query: &'life1 T,
params: &'life2 [&'life3 (dyn ToSql + Sync)],
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>where
T: ?Sized + ToStatement + Sync + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Like Client::execute
.
sourcefn execute_raw<'life0, 'life1, 'async_trait, P, I, T>(
&'life0 self,
statement: &'life1 T,
params: I,
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>where
T: ?Sized + ToStatement + Sync + Send + 'async_trait,
P: BorrowToSql + 'async_trait,
I: IntoIterator<Item = P> + Sync + Send + 'async_trait,
I::IntoIter: ExactSizeIterator,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute_raw<'life0, 'life1, 'async_trait, P, I, T>(
&'life0 self,
statement: &'life1 T,
params: I,
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>where
T: ?Sized + ToStatement + Sync + Send + 'async_trait,
P: BorrowToSql + 'async_trait,
I: IntoIterator<Item = P> + Sync + Send + 'async_trait,
I::IntoIter: ExactSizeIterator,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Like Client::execute_raw
.
sourcefn query<'life0, 'life1, 'life2, 'life3, 'async_trait, T>(
&'life0 self,
query: &'life1 T,
params: &'life2 [&'life3 (dyn ToSql + Sync)],
) -> Pin<Box<dyn Future<Output = Result<Vec<Row>, Error>> + Send + 'async_trait>>where
T: ?Sized + ToStatement + Sync + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn query<'life0, 'life1, 'life2, 'life3, 'async_trait, T>(
&'life0 self,
query: &'life1 T,
params: &'life2 [&'life3 (dyn ToSql + Sync)],
) -> Pin<Box<dyn Future<Output = Result<Vec<Row>, Error>> + Send + 'async_trait>>where
T: ?Sized + ToStatement + Sync + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Like Client::query
.
sourcefn query_one<'life0, 'life1, 'life2, 'life3, 'async_trait, T>(
&'life0 self,
statement: &'life1 T,
params: &'life2 [&'life3 (dyn ToSql + Sync)],
) -> Pin<Box<dyn Future<Output = Result<Row, Error>> + Send + 'async_trait>>where
T: ?Sized + ToStatement + Sync + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn query_one<'life0, 'life1, 'life2, 'life3, 'async_trait, T>(
&'life0 self,
statement: &'life1 T,
params: &'life2 [&'life3 (dyn ToSql + Sync)],
) -> Pin<Box<dyn Future<Output = Result<Row, Error>> + Send + 'async_trait>>where
T: ?Sized + ToStatement + Sync + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Like Client::query_one
.
sourcefn query_opt<'life0, 'life1, 'life2, 'life3, 'async_trait, T>(
&'life0 self,
statement: &'life1 T,
params: &'life2 [&'life3 (dyn ToSql + Sync)],
) -> Pin<Box<dyn Future<Output = Result<Option<Row>, Error>> + Send + 'async_trait>>where
T: ?Sized + ToStatement + Sync + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn query_opt<'life0, 'life1, 'life2, 'life3, 'async_trait, T>(
&'life0 self,
statement: &'life1 T,
params: &'life2 [&'life3 (dyn ToSql + Sync)],
) -> Pin<Box<dyn Future<Output = Result<Option<Row>, Error>> + Send + 'async_trait>>where
T: ?Sized + ToStatement + Sync + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Like Client::query_opt
.
sourcefn query_raw<'life0, 'life1, 'async_trait, T, P, I>(
&'life0 self,
statement: &'life1 T,
params: I,
) -> Pin<Box<dyn Future<Output = Result<RowStream, Error>> + Send + 'async_trait>>where
T: ?Sized + ToStatement + Sync + Send + 'async_trait,
P: BorrowToSql + 'async_trait,
I: IntoIterator<Item = P> + Sync + Send + 'async_trait,
I::IntoIter: ExactSizeIterator,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn query_raw<'life0, 'life1, 'async_trait, T, P, I>(
&'life0 self,
statement: &'life1 T,
params: I,
) -> Pin<Box<dyn Future<Output = Result<RowStream, Error>> + Send + 'async_trait>>where
T: ?Sized + ToStatement + Sync + Send + 'async_trait,
P: BorrowToSql + 'async_trait,
I: IntoIterator<Item = P> + Sync + Send + 'async_trait,
I::IntoIter: ExactSizeIterator,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Like Client::query_raw
.
sourcefn query_typed<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
statement: &'life1 str,
params: &'life2 [(&'life3 (dyn ToSql + Sync), Type)],
) -> Pin<Box<dyn Future<Output = Result<Vec<Row>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn query_typed<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
statement: &'life1 str,
params: &'life2 [(&'life3 (dyn ToSql + Sync), Type)],
) -> Pin<Box<dyn Future<Output = Result<Vec<Row>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Like Client::query_typed
sourcefn query_typed_raw<'life0, 'life1, 'async_trait, P, I>(
&'life0 self,
statement: &'life1 str,
params: I,
) -> Pin<Box<dyn Future<Output = Result<RowStream, Error>> + Send + 'async_trait>>where
P: BorrowToSql + 'async_trait,
I: IntoIterator<Item = (P, Type)> + Sync + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn query_typed_raw<'life0, 'life1, 'async_trait, P, I>(
&'life0 self,
statement: &'life1 str,
params: I,
) -> Pin<Box<dyn Future<Output = Result<RowStream, Error>> + Send + 'async_trait>>where
P: BorrowToSql + 'async_trait,
I: IntoIterator<Item = (P, Type)> + Sync + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
sourcefn prepare<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Statement, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn prepare<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Statement, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Like Client::prepare
.
sourcefn prepare_typed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 str,
parameter_types: &'life2 [Type],
) -> Pin<Box<dyn Future<Output = Result<Statement, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn prepare_typed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 str,
parameter_types: &'life2 [Type],
) -> Pin<Box<dyn Future<Output = Result<Statement, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Like Client::prepare_typed
.
sourcefn transaction<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Transaction<'_>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn transaction<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Transaction<'_>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Like Client::transaction
.
sourcefn batch_execute<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn batch_execute<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Like Client::batch_execute
.
sourcefn simple_query<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<SimpleQueryMessage>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn simple_query<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<SimpleQueryMessage>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Like Client::simple_query
.
Object Safety§
This trait is not object safe.