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§
sourcefn execute<T>(
&self,
query: &T,
params: &[&(dyn ToSql + Sync)]
) -> impl Future<Output = Result<u64, Error>> + Send
fn execute<T>( &self, query: &T, params: &[&(dyn ToSql + Sync)] ) -> impl Future<Output = Result<u64, Error>> + Send
Like Client::execute
.
sourcefn execute_raw<P, I, T>(
&self,
statement: &T,
params: I
) -> impl Future<Output = Result<u64, Error>> + Sendwhere
T: ?Sized + ToStatement + Sync + Send,
P: BorrowToSql,
I: IntoIterator<Item = P> + Sync + Send,
I::IntoIter: ExactSizeIterator,
fn execute_raw<P, I, T>(
&self,
statement: &T,
params: I
) -> impl Future<Output = Result<u64, Error>> + Sendwhere
T: ?Sized + ToStatement + Sync + Send,
P: BorrowToSql,
I: IntoIterator<Item = P> + Sync + Send,
I::IntoIter: ExactSizeIterator,
Like Client::execute_raw
.
sourcefn query<T>(
&self,
query: &T,
params: &[&(dyn ToSql + Sync)]
) -> impl Future<Output = Result<Vec<Row>, Error>> + Send
fn query<T>( &self, query: &T, params: &[&(dyn ToSql + Sync)] ) -> impl Future<Output = Result<Vec<Row>, Error>> + Send
Like Client::query
.
sourcefn query_one<T>(
&self,
statement: &T,
params: &[&(dyn ToSql + Sync)]
) -> impl Future<Output = Result<Row, Error>> + Send
fn query_one<T>( &self, statement: &T, params: &[&(dyn ToSql + Sync)] ) -> impl Future<Output = Result<Row, Error>> + Send
Like Client::query_one
.
sourcefn query_opt<T>(
&self,
statement: &T,
params: &[&(dyn ToSql + Sync)]
) -> impl Future<Output = Result<Option<Row>, Error>> + Send
fn query_opt<T>( &self, statement: &T, params: &[&(dyn ToSql + Sync)] ) -> impl Future<Output = Result<Option<Row>, Error>> + Send
Like Client::query_opt
.
sourcefn query_raw<T, P, I>(
&self,
statement: &T,
params: I
) -> impl Future<Output = Result<RowStream, Error>> + Sendwhere
T: ?Sized + ToStatement + Sync + Send,
P: BorrowToSql,
I: IntoIterator<Item = P> + Sync + Send,
I::IntoIter: ExactSizeIterator,
fn query_raw<T, P, I>(
&self,
statement: &T,
params: I
) -> impl Future<Output = Result<RowStream, Error>> + Sendwhere
T: ?Sized + ToStatement + Sync + Send,
P: BorrowToSql,
I: IntoIterator<Item = P> + Sync + Send,
I::IntoIter: ExactSizeIterator,
Like Client::query_raw
.
sourcefn prepare(
&self,
query: &str
) -> impl Future<Output = Result<Statement, Error>> + Send
fn prepare( &self, query: &str ) -> impl Future<Output = Result<Statement, Error>> + Send
Like Client::prepare
.
sourcefn prepare_typed(
&self,
query: &str,
parameter_types: &[Type]
) -> impl Future<Output = Result<Statement, Error>> + Send
fn prepare_typed( &self, query: &str, parameter_types: &[Type] ) -> impl Future<Output = Result<Statement, Error>> + Send
Like Client::prepare_typed
.
sourcefn prepare_cached(
&self,
query: &str
) -> impl Future<Output = Result<Statement, Error>> + Send
fn prepare_cached( &self, query: &str ) -> impl Future<Output = Result<Statement, Error>> + Send
Like Client::prepare_cached
.
sourcefn prepare_typed_cached(
&self,
query: &str,
types: &[Type]
) -> impl Future<Output = Result<Statement, Error>> + Send
fn prepare_typed_cached( &self, query: &str, types: &[Type] ) -> impl Future<Output = Result<Statement, Error>> + Send
sourcefn transaction(
&mut self
) -> impl Future<Output = Result<Transaction<'_>, Error>> + Send
fn transaction( &mut self ) -> impl Future<Output = Result<Transaction<'_>, Error>> + Send
Like Client::transaction
.
Object Safety§
This trait is not object safe.