pub struct Txn { /* private fields */ }
Expand description
A handle which is used to control a transaction, created as a result of crate::Graph::start_txn
When a transation is started, a dedicated connection is resered and moved into the handle which
will be released to the connection pool when the Txn
handle is dropped.
Implementations§
source§impl Txn
impl Txn
sourcepub async fn run_queries<Q: Into<Query>>(
&mut self,
queries: impl IntoIterator<Item = Q>
) -> Result<()>
pub async fn run_queries<Q: Into<Query>>( &mut self, queries: impl IntoIterator<Item = Q> ) -> Result<()>
Runs multiple queries one after the other in the same connection
sourcepub async fn run(&mut self, q: Query) -> Result<()>
pub async fn run(&mut self, q: Query) -> Result<()>
Runs a single query and discards the stream.
sourcepub async fn execute(&mut self, q: Query) -> Result<RowStream>
pub async fn execute(&mut self, q: Query) -> Result<RowStream>
Executes a query and returns a RowStream
pub fn handle(&mut self) -> &mut impl TransactionHandle
Auto Trait Implementations§
impl !RefUnwindSafe for Txn
impl Send for Txn
impl Sync for Txn
impl Unpin for Txn
impl !UnwindSafe for Txn
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