Trait postgres::GenericClient

source ·
pub trait GenericClient: Sealed {
Show 14 methods // Required methods fn execute<T>( &mut self, query: &T, params: &[&(dyn ToSql + Sync)], ) -> Result<u64, Error> where T: ?Sized + ToStatement; fn query<T>( &mut self, query: &T, params: &[&(dyn ToSql + Sync)], ) -> Result<Vec<Row>, Error> where T: ?Sized + ToStatement; fn query_one<T>( &mut self, query: &T, params: &[&(dyn ToSql + Sync)], ) -> Result<Row, Error> where T: ?Sized + ToStatement; fn query_opt<T>( &mut self, query: &T, params: &[&(dyn ToSql + Sync)], ) -> Result<Option<Row>, Error> where T: ?Sized + ToStatement; fn query_raw<T, P, I>( &mut self, query: &T, params: I, ) -> Result<RowIter<'_>, Error> where T: ?Sized + ToStatement, P: BorrowToSql, I: IntoIterator<Item = P>, I::IntoIter: ExactSizeIterator; fn query_typed( &mut self, statement: &str, params: &[(&(dyn ToSql + Sync), Type)], ) -> Result<Vec<Row>, Error>; fn query_typed_raw<P, I>( &mut self, statement: &str, params: I, ) -> Result<RowIter<'_>, Error> where P: BorrowToSql, I: IntoIterator<Item = (P, Type)> + Sync + Send; fn prepare(&mut self, query: &str) -> Result<Statement, Error>; fn prepare_typed( &mut self, query: &str, types: &[Type], ) -> Result<Statement, Error>; fn copy_in<T>(&mut self, query: &T) -> Result<CopyInWriter<'_>, Error> where T: ?Sized + ToStatement; fn copy_out<T>(&mut self, query: &T) -> Result<CopyOutReader<'_>, Error> where T: ?Sized + ToStatement; fn simple_query( &mut self, query: &str, ) -> Result<Vec<SimpleQueryMessage>, Error>; fn batch_execute(&mut self, query: &str) -> Result<(), Error>; fn transaction(&mut self) -> Result<Transaction<'_>, Error>;
}
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>( &mut self, query: &T, params: &[&(dyn ToSql + Sync)], ) -> Result<u64, Error>
where T: ?Sized + ToStatement,

Like Client::execute.

source

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

Like Client::query.

source

fn query_one<T>( &mut self, query: &T, params: &[&(dyn ToSql + Sync)], ) -> Result<Row, Error>
where T: ?Sized + ToStatement,

Like Client::query_one.

source

fn query_opt<T>( &mut self, query: &T, params: &[&(dyn ToSql + Sync)], ) -> Result<Option<Row>, Error>
where T: ?Sized + ToStatement,

Like Client::query_opt.

source

fn query_raw<T, P, I>( &mut self, query: &T, params: I, ) -> Result<RowIter<'_>, Error>

Like Client::query_raw.

source

fn query_typed( &mut self, statement: &str, params: &[(&(dyn ToSql + Sync), Type)], ) -> Result<Vec<Row>, Error>

source

fn query_typed_raw<P, I>( &mut self, statement: &str, params: I, ) -> Result<RowIter<'_>, Error>
where P: BorrowToSql, I: IntoIterator<Item = (P, Type)> + Sync + Send,

source

fn prepare(&mut self, query: &str) -> Result<Statement, Error>

Like Client::prepare.

source

fn prepare_typed( &mut self, query: &str, types: &[Type], ) -> Result<Statement, Error>

Like Client::prepare_typed.

source

fn copy_in<T>(&mut self, query: &T) -> Result<CopyInWriter<'_>, Error>
where T: ?Sized + ToStatement,

Like Client::copy_in.

source

fn copy_out<T>(&mut self, query: &T) -> Result<CopyOutReader<'_>, Error>
where T: ?Sized + ToStatement,

Like Client::copy_out.

source

fn simple_query( &mut self, query: &str, ) -> Result<Vec<SimpleQueryMessage>, Error>

Like Client::simple_query.

source

fn batch_execute(&mut self, query: &str) -> Result<(), Error>

Like Client::batch_execute.

source

fn transaction(&mut self) -> Result<Transaction<'_>, Error>

Like Client::transaction.

Object Safety§

This trait is not object safe.

Implementors§