Trait deadpool_postgres::GenericClient

source ·
pub trait GenericClient: Sync + Sealed {
    // Required methods
    fn execute<T>(
        &self,
        query: &T,
        params: &[&(dyn ToSql + Sync)]
    ) -> impl Future<Output = Result<u64, Error>> + Send
       where T: ?Sized + ToStatement + Sync + Send;
    fn execute_raw<P, I, T>(
        &self,
        statement: &T,
        params: I
    ) -> impl Future<Output = Result<u64, Error>> + Send
       where T: ?Sized + ToStatement + Sync + Send,
             P: BorrowToSql,
             I: IntoIterator<Item = P> + Sync + Send,
             I::IntoIter: ExactSizeIterator;
    fn query<T>(
        &self,
        query: &T,
        params: &[&(dyn ToSql + Sync)]
    ) -> impl Future<Output = Result<Vec<Row>, Error>> + Send
       where T: ?Sized + ToStatement + Sync + Send;
    fn query_one<T>(
        &self,
        statement: &T,
        params: &[&(dyn ToSql + Sync)]
    ) -> impl Future<Output = Result<Row, Error>> + Send
       where T: ?Sized + ToStatement + Sync + Send;
    fn query_opt<T>(
        &self,
        statement: &T,
        params: &[&(dyn ToSql + Sync)]
    ) -> impl Future<Output = Result<Option<Row>, Error>> + Send
       where T: ?Sized + ToStatement + Sync + Send;
    fn query_raw<T, P, I>(
        &self,
        statement: &T,
        params: I
    ) -> impl Future<Output = Result<RowStream, Error>> + Send
       where T: ?Sized + ToStatement + Sync + Send,
             P: BorrowToSql,
             I: IntoIterator<Item = P> + Sync + Send,
             I::IntoIter: ExactSizeIterator;
    fn prepare(
        &self,
        query: &str
    ) -> impl Future<Output = Result<Statement, Error>> + Send;
    fn prepare_typed(
        &self,
        query: &str,
        parameter_types: &[Type]
    ) -> impl Future<Output = Result<Statement, Error>> + Send;
    fn prepare_cached(
        &self,
        query: &str
    ) -> impl Future<Output = Result<Statement, Error>> + Send;
    fn prepare_typed_cached(
        &self,
        query: &str,
        types: &[Type]
    ) -> impl Future<Output = Result<Statement, Error>> + Send;
    fn transaction(
        &mut self
    ) -> impl Future<Output = Result<Transaction<'_>, Error>> + Send;
    fn batch_execute(
        &self,
        query: &str
    ) -> impl Future<Output = Result<(), Error>> + Send;
}
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<T>( &self, query: &T, params: &[&(dyn ToSql + Sync)] ) -> impl Future<Output = Result<u64, Error>> + Send
where T: ?Sized + ToStatement + Sync + Send,

Like Client::execute.

source

fn execute_raw<P, I, T>( &self, statement: &T, params: I ) -> impl Future<Output = Result<u64, Error>> + Send

Like Client::execute_raw.

source

fn query<T>( &self, query: &T, params: &[&(dyn ToSql + Sync)] ) -> impl Future<Output = Result<Vec<Row>, Error>> + Send
where T: ?Sized + ToStatement + Sync + Send,

Like Client::query.

source

fn query_one<T>( &self, statement: &T, params: &[&(dyn ToSql + Sync)] ) -> impl Future<Output = Result<Row, Error>> + Send
where T: ?Sized + ToStatement + Sync + Send,

Like Client::query_one.

source

fn query_opt<T>( &self, statement: &T, params: &[&(dyn ToSql + Sync)] ) -> impl Future<Output = Result<Option<Row>, Error>> + Send
where T: ?Sized + ToStatement + Sync + Send,

Like Client::query_opt.

source

fn query_raw<T, P, I>( &self, statement: &T, params: I ) -> impl Future<Output = Result<RowStream, Error>> + Send

Like Client::query_raw.

source

fn prepare( &self, query: &str ) -> impl Future<Output = Result<Statement, Error>> + Send

Like Client::prepare.

source

fn prepare_typed( &self, query: &str, parameter_types: &[Type] ) -> impl Future<Output = Result<Statement, Error>> + Send

Like Client::prepare_typed.

source

fn prepare_cached( &self, query: &str ) -> impl Future<Output = Result<Statement, Error>> + Send

source

fn prepare_typed_cached( &self, query: &str, types: &[Type] ) -> impl Future<Output = Result<Statement, Error>> + Send

source

fn transaction( &mut self ) -> impl Future<Output = Result<Transaction<'_>, Error>> + Send

Like Client::transaction.

source

fn batch_execute( &self, query: &str ) -> impl Future<Output = Result<(), Error>> + Send

Like Client::batch_execute.

Object Safety§

This trait is not object safe.

Implementors§