[−][src]Struct mysql_async::Transaction
This struct represents MySql transaction.
Transaction
it's a sugar for START TRANSACTION
, ROLLBACK
and COMMIT
queries, so one
should note that it is easy to mess things up calling this queries manually. Also you will get
NestedTransaction
error if you call transaction.start_transaction(_)
.
Methods
impl<T: Queryable + ConnectionLike> Transaction<T>
[src]
pub fn commit(self) -> impl MyFuture<T>
[src]
Returns future that will perform COMMIT
query and resolve to a wrapped Queryable
.
pub fn rollback(self) -> impl MyFuture<T>
[src]
Returns future that will perform ROLLBACK
query and resolve to a wrapped Queryable
.
Trait Implementations
impl<T: Queryable + ConnectionLike> Queryable for Transaction<T>
[src]
fn ping(self) -> BoxFuture<Self>
[src]
Returns future that resolves to Conn
if COM_PING
executed successfully.
fn disconnect(self) -> BoxFuture<()>
[src]
Returns future that disconnects this connection from a server.
fn query<Q: AsRef<str>>(
self,
query: Q
) -> BoxFuture<QueryResult<Self, TextProtocol>>
[src]
self,
query: Q
) -> BoxFuture<QueryResult<Self, TextProtocol>>
Returns future that performs query
.
fn first<Q, R>(self, query: Q) -> BoxFuture<(Self, Option<R>)> where
Q: AsRef<str>,
R: FromRow,
[src]
Q: AsRef<str>,
R: FromRow,
Returns future that resolves to a first row of result of a query
execution (if any). Read more
fn drop_query<Q: AsRef<str>>(self, query: Q) -> BoxFuture<Self>
[src]
Returns future that performs query. Result will be dropped.
fn prepare<Q: AsRef<str>>(self, query: Q) -> BoxFuture<Stmt<Self>>
[src]
Returns future that prepares statement.
fn prep_exec<Q, P>(
self,
query: Q,
params: P
) -> BoxFuture<QueryResult<Self, BinaryProtocol>> where
Q: AsRef<str>,
P: Into<Params>,
[src]
self,
query: Q,
params: P
) -> BoxFuture<QueryResult<Self, BinaryProtocol>> where
Q: AsRef<str>,
P: Into<Params>,
Returns future that prepares and executes statement in one pass.
fn first_exec<Q, P, R>(
self,
query: Q,
params: P
) -> BoxFuture<(Self, Option<R>)> where
Q: AsRef<str>,
P: Into<Params>,
R: FromRow,
[src]
self,
query: Q,
params: P
) -> BoxFuture<(Self, Option<R>)> where
Q: AsRef<str>,
P: Into<Params>,
R: FromRow,
Returns future that resolves to a first row of result of a statement execution (if any). Read more
fn drop_exec<Q, P>(self, query: Q, params: P) -> BoxFuture<Self> where
Q: AsRef<str>,
P: Into<Params>,
[src]
Q: AsRef<str>,
P: Into<Params>,
Returns future that prepares and executes statement. Result will be dropped.
fn batch_exec<Q, I, P>(self, query: Q, params_iter: I) -> BoxFuture<Self> where
Q: AsRef<str>,
I: IntoIterator<Item = P> + Send + 'static,
I::IntoIter: Send + 'static,
Params: From<P>,
P: Send + 'static,
[src]
Q: AsRef<str>,
I: IntoIterator<Item = P> + Send + 'static,
I::IntoIter: Send + 'static,
Params: From<P>,
P: Send + 'static,
Returns future that prepares statement and performs batch execution. Results will be dropped. Read more
fn start_transaction(
self,
options: TransactionOptions
) -> BoxFuture<Transaction<Self>>
[src]
self,
options: TransactionOptions
) -> BoxFuture<Transaction<Self>>
Returns future that starts transaction.
Auto Trait Implementations
impl<T> Send for Transaction<T> where
T: Send,
T: Send,
impl<T> Sync for Transaction<T> where
T: Sync,
T: Sync,
Blanket Implementations
impl<T> ConnectionLike for T where
T: ConnectionLike,
[src]
T: ConnectionLike,
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self