Struct rbatis::executor::RBatisTxExecutor
source · [−]pub struct RBatisTxExecutor {
pub tx_id: i64,
pub conn: Box<dyn Connection>,
pub rb: Rbatis,
pub done: bool,
}
Fields
tx_id: i64
conn: Box<dyn Connection>
rb: Rbatis
done: bool
Implementations
sourceimpl<'a> RBatisTxExecutor
impl<'a> RBatisTxExecutor
sourcepub async fn fetch_decode<T>(
&mut self,
sql: &str,
args: Vec<Value>
) -> Result<Value, Error> where
T: DeserializeOwned,
pub async fn fetch_decode<T>(
&mut self,
sql: &str,
args: Vec<Value>
) -> Result<Value, Error> where
T: DeserializeOwned,
fetch and decode
sourceimpl RBatisTxExecutor
impl RBatisTxExecutor
pub async fn begin(self) -> Result<Self>
pub async fn commit(&mut self) -> Result<bool>
pub async fn rollback(&mut self) -> Result<bool>
pub fn take_conn(self) -> Box<dyn Connection>ⓘNotable traits for Box<R, Global>impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
sourceimpl RBatisTxExecutor
impl RBatisTxExecutor
sourcepub fn defer_async<R, F>(self, callback: F) -> RBatisTxExecutorGuard where
R: Future<Output = ()> + 'static + Send,
F: Send + FnMut(RBatisTxExecutor) -> R + 'static,
pub fn defer_async<R, F>(self, callback: F) -> RBatisTxExecutorGuard where
R: Future<Output = ()> + 'static + Send,
F: Send + FnMut(RBatisTxExecutor) -> R + 'static,
defer and use future method for example: tx.defer_async(|mut tx| async { tx.rollback().await; });
Trait Implementations
sourceimpl Debug for RBatisTxExecutor
impl Debug for RBatisTxExecutor
sourceimpl Deref for RBatisTxExecutor
impl Deref for RBatisTxExecutor
sourceimpl DerefMut for RBatisTxExecutor
impl DerefMut for RBatisTxExecutor
sourceimpl Executor for RBatisTxExecutor
impl Executor for RBatisTxExecutor
fn exec<'life0, 'life1, 'async_trait>(
&'life0 mut self,
sql: &'life1 str,
args: Vec<Value>
) -> Pin<Box<dyn Future<Output = Result<ExecResult, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn fetch<'life0, 'life1, 'async_trait>(
&'life0 mut self,
sql: &'life1 str,
args: Vec<Value>
) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
sourceimpl RbatisRef for RBatisTxExecutor
impl RbatisRef for RBatisTxExecutor
fn get_rbatis(&self) -> &Rbatis
fn driver_type(&self) -> Result<&str>
Auto Trait Implementations
impl !RefUnwindSafe for RBatisTxExecutor
impl Send for RBatisTxExecutor
impl !Sync for RBatisTxExecutor
impl Unpin for RBatisTxExecutor
impl !UnwindSafe for RBatisTxExecutor
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more