Struct neo4rs::Txn

source ·
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

source

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

source

pub async fn run(&mut self, q: Query) -> Result<()>

Runs a single query and discards the stream.

source

pub async fn execute(&mut self, q: Query) -> Result<RowStream>

Executes a query and returns a RowStream

source

pub async fn commit(self) -> Result<()>

Commits the transaction in progress

source

pub async fn rollback(self) -> Result<()>

rollback/abort the current transaction

source

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.