tokio_postgres

Trait 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§

source

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,

source

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,

source

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,

source

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,

source

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,

source

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,

source

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,

source

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,

source

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,

source

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,

source

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,

source

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,

source

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,

source

fn client(&self) -> &Client

Returns a reference to the underlying Client.

Object Safety§

This trait is not object safe.

Implementors§