Trait mysql_async::prelude::Queryable
[−]
[src]
pub trait Queryable: ConnectionLike where
Self: Sized + 'static, { fn ping(self) -> BoxFuture<Self> { ... } fn disconnect(self) -> BoxFuture<()> { ... } fn query<Q: AsRef<str>>(
self,
query: Q
) -> BoxFuture<QueryResult<Self, TextProtocol>> { ... } fn first<Q, R>(self, query: Q) -> BoxFuture<(Self, Option<R>)>
where
Q: AsRef<str>,
R: FromRow, { ... } fn drop_query<Q: AsRef<str>>(self, query: Q) -> BoxFuture<Self> { ... } fn prepare<Q: AsRef<str>>(self, query: Q) -> BoxFuture<Stmt<Self>> { ... } fn prep_exec<Q, P>(
self,
query: Q,
params: P
) -> BoxFuture<QueryResult<Self, BinaryProtocol>>
where
Q: AsRef<str>,
P: Into<Params>, { ... } fn first_exec<Q, P, R>(
self,
query: Q,
params: P
) -> BoxFuture<(Self, Option<R>)>
where
Q: AsRef<str>,
P: Into<Params>,
R: FromRow, { ... } fn drop_exec<Q, P>(self, query: Q, params: P) -> BoxFuture<Self>
where
Q: AsRef<str>,
P: Into<Params>, { ... } fn batch_exec<Q, I, P>(self, query: Q, params_iter: I) -> BoxFuture<Self>
where
Q: AsRef<str>,
I: IntoIterator<Item = P> + 'static,
Params: From<P>,
P: 'static, { ... } fn start_transaction(
self,
options: TransactionOptions
) -> BoxFuture<Transaction<Self>> { ... } }
Represents something queryable like connection or transaction.
Provided Methods
fn ping(self) -> BoxFuture<Self>
Returns future that resolves to Conn
if COM_PING
executed successfully.
fn disconnect(self) -> BoxFuture<()>
Returns future that disconnects this connection from a server.
fn query<Q: AsRef<str>>(
self,
query: Q
) -> BoxFuture<QueryResult<Self, TextProtocol>>
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,
Q: AsRef<str>,
R: FromRow,
Returns future that resolves to a first row of result of a query
execution (if any).
Returned future will call R::from_row(row)
internally.
fn drop_query<Q: AsRef<str>>(self, query: Q) -> BoxFuture<Self>
Returns future that performs query. Result will be dropped.
fn prepare<Q: AsRef<str>>(self, query: Q) -> BoxFuture<Stmt<Self>>
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>,
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,
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).
Returned future will call R::from_row(row)
internally.
fn drop_exec<Q, P>(self, query: Q, params: P) -> BoxFuture<Self> where
Q: AsRef<str>,
P: Into<Params>,
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> + 'static,
Params: From<P>,
P: 'static,
Q: AsRef<str>,
I: IntoIterator<Item = P> + 'static,
Params: From<P>,
P: 'static,
Returns future that prepares statement and performs batch execution. Results will be dropped.
fn start_transaction(
self,
options: TransactionOptions
) -> BoxFuture<Transaction<Self>>
self,
options: TransactionOptions
) -> BoxFuture<Transaction<Self>>
Returns future that starts transaction.
Implementors
impl Queryable for Conn
impl<T: Queryable + ConnectionLike> Queryable for Transaction<T>