pub struct DBTx<'a> {
pub driver_type: DriverType,
pub conn: Option<DBPoolConn<'a>>,
pub done: bool,
}
Fields§
§driver_type: DriverType
§conn: Option<DBPoolConn<'a>>
§done: bool
is tx done?
Implementations§
Source§impl<'a> DBTx<'a>
impl<'a> DBTx<'a>
pub fn make_query<'f, 's>(&'f self, sql: &'s str) -> Result<DBQuery<'s>>
pub fn is_done(&self) -> bool
pub fn take_conn(self) -> Option<DBPoolConn<'a>>
pub fn get_conn_mut(&mut self) -> Result<&mut DBPoolConn<'a>>
pub async fn begin(&mut self) -> Result<()>
pub async fn commit(&mut self) -> Result<()>
pub async fn rollback(&mut self) -> Result<()>
pub async fn fetch<'q, T>(&mut self, sql: &'q str) -> Result<(T, usize)>where
T: DeserializeOwned,
pub async fn fetch_parperd<'q, T>(
&mut self,
sql: DBQuery<'q>,
) -> Result<(T, usize)>where
T: DeserializeOwned,
pub async fn exec_sql(&mut self, sql: &str) -> Result<DBExecResult>
pub async fn exec_prepare(&mut self, sql: DBQuery<'_>) -> Result<DBExecResult>
Trait Implementations§
Auto Trait Implementations§
impl<'a> !Freeze for DBTx<'a>
impl<'a> !RefUnwindSafe for DBTx<'a>
impl<'a> Send for DBTx<'a>
impl<'a> !Sync for DBTx<'a>
impl<'a> Unpin for DBTx<'a>
impl<'a> !UnwindSafe for DBTx<'a>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more