Struct mysql::Transaction
source · pub struct Transaction<'a> { /* private fields */ }
Implementations§
source§impl<'a> Transaction<'a>
impl<'a> Transaction<'a>
sourcepub fn query<T: AsRef<str>>(&mut self, query: T) -> MyResult<QueryResult<'_>>
pub fn query<T: AsRef<str>>(&mut self, query: T) -> MyResult<QueryResult<'_>>
See Conn::query
.
sourcepub fn first<T: AsRef<str>, U: FromRow>(
&mut self,
query: T
) -> MyResult<Option<U>>
pub fn first<T: AsRef<str>, U: FromRow>(
&mut self,
query: T
) -> MyResult<Option<U>>
See Conn::first
.
sourcepub fn prep_exec<A: AsRef<str>, T: Into<Params>>(
&mut self,
query: A,
params: T
) -> MyResult<QueryResult<'_>>
pub fn prep_exec<A: AsRef<str>, T: Into<Params>>(
&mut self,
query: A,
params: T
) -> MyResult<QueryResult<'_>>
See Conn::prep_exec
.
sourcepub fn first_exec<Q, P, T>(&mut self, query: Q, params: P) -> MyResult<Option<T>>where
Q: AsRef<str>,
P: Into<Params>,
T: FromRow,
pub fn first_exec<Q, P, T>(&mut self, query: Q, params: P) -> MyResult<Option<T>>where
Q: AsRef<str>,
P: Into<Params>,
T: FromRow,
See Conn::first_exec
.
sourcepub fn rollback(self) -> MyResult<()>
pub fn rollback(self) -> MyResult<()>
Will consume and rollback transaction. You also can rely on Drop
implementation but it
will swallow errors.
sourcepub fn set_local_infile_handler(&mut self, handler: Option<LocalInfileHandler>)
pub fn set_local_infile_handler(&mut self, handler: Option<LocalInfileHandler>)
A way to override local infile handler for this transaction. Destructor of transaction will restore original handler.
Trait Implementations§
source§impl<'a> Debug for Transaction<'a>
impl<'a> Debug for Transaction<'a>
source§impl<'a> GenericConnection for Transaction<'a>
impl<'a> GenericConnection for Transaction<'a>
source§fn query<T: AsRef<str>>(&mut self, query: T) -> MyResult<QueryResult<'_>>
fn query<T: AsRef<str>>(&mut self, query: T) -> MyResult<QueryResult<'_>>
See
Conn#query
. Read moresource§fn first<T: AsRef<str>, U: FromRow>(&mut self, query: T) -> MyResult<Option<U>>
fn first<T: AsRef<str>, U: FromRow>(&mut self, query: T) -> MyResult<Option<U>>
See
Conn#first
. Read moresource§fn prepare<T: AsRef<str>>(&mut self, query: T) -> MyResult<Stmt<'_>>
fn prepare<T: AsRef<str>>(&mut self, query: T) -> MyResult<Stmt<'_>>
See
Conn#prepare
. Read more