Struct mysql_async::Conn
[−]
[src]
pub struct Conn { /* fields omitted */ }
Mysql connection
Methods
impl Conn
[src]
fn new<O>(opts: O, handle: &Handle) -> NewConn where
O: Into<Opts>,
O: Into<Opts>,
Returns future that resolves to Conn
.
fn ping(self) -> Ping
Returns future that resolves to Conn
if COM_PING
executed successfully.
fn query<Q: AsRef<str>>(self, query: Q) -> Query
Returns future that executes query
and resolves to TextQueryResult
.
fn first<R, Q>(self, query: Q) -> First<R> where
Q: AsRef<str>,
R: FromRow,
Q: AsRef<str>,
R: FromRow,
Returns future that resolves to a first row of result of a query
execution (if any).
fn drop_query<Q: AsRef<str>>(self, query: Q) -> DropQuery
Returns future that performs query, drops result and resolves to Conn
.
fn prepare<Q>(self, query: Q) -> Prepare where
Q: AsRef<str>,
Q: AsRef<str>,
Returns future that resolves to a Stmt
.
fn prep_exec<Q, P>(self, query: Q, params: P) -> PrepExec where
Q: AsRef<str>,
P: Into<Params>,
Q: AsRef<str>,
P: Into<Params>,
Returns future that prepares and executes statement in one pass and resolves to
BinQueryResult
.
fn first_exec<R, Q, P>(self, query: Q, params: P) -> FirstExec<R> where
Q: AsRef<str>,
P: Into<Params>,
R: FromRow,
Q: AsRef<str>,
P: Into<Params>,
R: FromRow,
Returns future that resolves to a first row of result of a statement execution (if any).
Returned future will call R::from_row(row)
internally.
fn drop_exec<Q, P>(self, query: Q, params: P) -> DropExec where
Q: AsRef<str>,
P: Into<Params>,
Q: AsRef<str>,
P: Into<Params>,
Returns future that prepares and executes statement, drops result and resolves to Conn
.
fn batch_exec<Q, P>(self, query: Q, params_vec: Vec<P>) -> BatchExec where
Q: AsRef<str>,
P: Into<Params>,
Q: AsRef<str>,
P: Into<Params>,
Returns future that prepares statement, performs batch execution and resolves to Conn
.
All results will be dropped.
fn reset(self) -> Reset
Returns future that resolves to a Conn
with COM_RESET_CONNECTION
executed on it.
fn disconnect(self) -> Disconnect
Returns future that consumes Conn
and disconnects it from a server.
fn start_transaction(
self,
consistent_snapshot: bool,
isolation_level: Option<IsolationLevel>,
readonly: Option<bool>
) -> StartTransaction
self,
consistent_snapshot: bool,
isolation_level: Option<IsolationLevel>,
readonly: Option<bool>
) -> StartTransaction
Returns future that starts transaction and resolves to Transaction
.