pub struct PostgresTransaction<'c>(/* private fields */);Expand description
Postgres transaction.
Implementations§
Source§impl<'c> PostgresTransaction<'c>
impl<'c> PostgresTransaction<'c>
pub async fn new(client: &'c mut PostgresConnection) -> Result<Self>
Trait Implementations§
Source§impl<'c> Executor for PostgresTransaction<'c>
impl<'c> Executor for PostgresTransaction<'c>
Source§type Driver = PostgresDriver
type Driver = PostgresDriver
Associated driver.
Source§async fn do_prepare(&mut self, sql: String) -> Result<Query<Self::Driver>>
async fn do_prepare(&mut self, sql: String) -> Result<Query<Self::Driver>>
Actual implementation for
prepare.Source§fn run<'s>(
&'s mut self,
query: impl AsQuery<Self::Driver> + 's,
) -> impl Stream<Item = Result<QueryResult>> + Send
fn run<'s>( &'s mut self, query: impl AsQuery<Self::Driver> + 's, ) -> impl Stream<Item = Result<QueryResult>> + Send
Execute a query, streaming
QueryResult (rows or affected counts).Source§fn accepts_multiple_statements(&self) -> bool
fn accepts_multiple_statements(&self) -> bool
Supports multiple statements per request.
Source§fn prepare<'s>(
&'s mut self,
query: impl AsQuery<Self::Driver> + 's,
) -> impl Future<Output = Result<Query<Self::Driver>, Error>> + Send
fn prepare<'s>( &'s mut self, query: impl AsQuery<Self::Driver> + 's, ) -> impl Future<Output = Result<Query<Self::Driver>, Error>> + Send
Prepare query.
Source§fn fetch<'s>(
&'s mut self,
query: impl AsQuery<Self::Driver> + 's,
) -> impl Stream<Item = Result<RowLabeled, Error>> + Send
fn fetch<'s>( &'s mut self, query: impl AsQuery<Self::Driver> + 's, ) -> impl Stream<Item = Result<RowLabeled, Error>> + Send
Execute a query yielding
RowLabeled from the resulting stream (filtering out RowsAffected).Source§fn execute<'s>(
&'s mut self,
query: impl AsQuery<Self::Driver> + 's,
) -> impl Future<Output = Result<RowsAffected, Error>> + Send
fn execute<'s>( &'s mut self, query: impl AsQuery<Self::Driver> + 's, ) -> impl Future<Output = Result<RowsAffected, Error>> + Send
Execute and aggregate affected rows counter.
Auto Trait Implementations§
impl<'c> Freeze for PostgresTransaction<'c>
impl<'c> !RefUnwindSafe for PostgresTransaction<'c>
impl<'c> Send for PostgresTransaction<'c>
impl<'c> Sync for PostgresTransaction<'c>
impl<'c> Unpin for PostgresTransaction<'c>
impl<'c> UnsafeUnpin for PostgresTransaction<'c>
impl<'c> !UnwindSafe for PostgresTransaction<'c>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more