Trait tokio_postgres::GenericClient

source ·
pub trait GenericClient: Sealed {
    // 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 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 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,

Like Client::execute.

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,

Like Client::execute_raw.

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,

Like Client::query.

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,

Like Client::query_one.

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,

Like Client::query_opt.

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,

Like Client::query_raw.

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,

Like Client::prepare.

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,

Like Client::prepare_typed.

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,

Like Client::transaction.

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,

Like Client::batch_execute.

source

fn client(&self) -> &Client

Returns a reference to the underlying Client.

Object Safety§

This trait is not object safe.

Implementors§