Struct mysql_async::QueryResult [−][src]
pub struct QueryResult<T, P>(_);
Result of a query or statement execution.
Methods
impl<T, P> QueryResult<T, P> where
P: Protocol,
P: Send + 'static,
T: ConnectionLike,
T: Sized + Send + 'static, [src]
impl<T, P> QueryResult<T, P> where
P: Protocol,
P: Send + 'static,
T: ConnectionLike,
T: Sized + Send + 'static, pub fn last_insert_id(&self) -> Option<u64>[src]
pub fn last_insert_id(&self) -> Option<u64>Last insert id (if not 0).
pub fn affected_rows(&self) -> u64[src]
pub fn affected_rows(&self) -> u64Value of affected_rows returned from a server.
pub fn is_empty(&self) -> bool[src]
pub fn is_empty(&self) -> booltrue if there is no more rows nor result sets in this query.
One could use it to check if there is more than one result set in this query result.
pub fn collect<R>(
self
) -> impl MyFuture<(Self, Vec<R>)> where
R: FromRow,
R: Send + 'static, [src]
pub fn collect<R>(
self
) -> impl MyFuture<(Self, Vec<R>)> where
R: FromRow,
R: Send + 'static, Returns future that collects result set of this query result.
It is parametrized by R and internally calls R::from_row(Row) on each row.
It will stop collecting on result set boundary. This means that you should call collect
as many times as result sets in your query result. For example query
SELECT 'foo'; SELECT 'foo', 'bar'; will produce QueryResult with two result sets in it.
One can use QueryResult::is_empty to make sure that there is no more result sets.
pub fn collect_and_drop<R>(
self
) -> impl MyFuture<(T, Vec<R>)> where
R: FromRow,
R: Send + 'static, [src]
pub fn collect_and_drop<R>(
self
) -> impl MyFuture<(T, Vec<R>)> where
R: FromRow,
R: Send + 'static, Returns future that collects result set of a query result and drops everything else.
It will resolve to a pair of wrapped Queryable and collected result set.
pub fn for_each<F>(
self,
fun: F
) -> Either<FutureResult<Self, Error>, ForEach<T, P, F>> where
F: FnMut(Row), [src]
pub fn for_each<F>(
self,
fun: F
) -> Either<FutureResult<Self, Error>, ForEach<T, P, F>> where
F: FnMut(Row), Returns future that will execute fun on every row of current result set.
It will stop on result set boundary (see QueryResult::collect docs).
pub fn for_each_and_drop<F>(self, fun: F) -> ForEachAndDrop<Self, T, P, F> where
F: FnMut(Row), [src]
pub fn for_each_and_drop<F>(self, fun: F) -> ForEachAndDrop<Self, T, P, F> where
F: FnMut(Row), Returns future that will execute fun on every row of current result set and drop
everything else. It will resolve to a wrapped Queryable.
pub fn map<F, U>(
self,
fun: F
) -> Either<FutureResult<(Self, Vec<U>), Error>, Map<T, P, F, U>> where
F: FnMut(Row) -> U, [src]
pub fn map<F, U>(
self,
fun: F
) -> Either<FutureResult<(Self, Vec<U>), Error>, Map<T, P, F, U>> where
F: FnMut(Row) -> U, Returns future that will map every row of current result set to U using fun.
It will stop on result set boundary (see QueryResult::collect docs).
pub fn map_and_drop<F, U>(self, fun: F) -> MapAndDrop<Self, T, P, F, U> where
F: FnMut(Row) -> U, [src]
pub fn map_and_drop<F, U>(self, fun: F) -> MapAndDrop<Self, T, P, F, U> where
F: FnMut(Row) -> U, Returns future that will map every row of current result set to U using fun and drop
everything else. It will resolve to a pair of wrapped Queryable and mapped result set.
pub fn reduce<F, U>(
self,
init: U,
fun: F
) -> Either<FutureResult<(Self, U), Error>, Reduce<T, P, F, U>> where
F: FnMut(U, Row) -> U, [src]
pub fn reduce<F, U>(
self,
init: U,
fun: F
) -> Either<FutureResult<(Self, U), Error>, Reduce<T, P, F, U>> where
F: FnMut(U, Row) -> U, Returns future that will reduce rows of current result set to U using fun.
It will stop on result set boundary (see QueryResult::collect docs).
pub fn reduce_and_drop<F, U>(
self,
init: U,
fun: F
) -> ReduceAndDrop<Self, T, P, F, U> where
F: FnMut(U, Row) -> U, [src]
pub fn reduce_and_drop<F, U>(
self,
init: U,
fun: F
) -> ReduceAndDrop<Self, T, P, F, U> where
F: FnMut(U, Row) -> U, Returns future that will reduce rows of current result set to U using fun and drop
everything else. It will resolve to a pair of wrapped Queryable and U.
pub fn drop_result(
self
) -> impl MyFuture<T>[src]
pub fn drop_result(
self
) -> impl MyFuture<T>Returns future that will drop this query result end resolve to a wrapped Queryable.
Auto Trait Implementations
impl<T, P> Send for QueryResult<T, P> where
P: Send,
T: Send,
impl<T, P> Send for QueryResult<T, P> where
P: Send,
T: Send, impl<T, P> Sync for QueryResult<T, P> where
P: Sync,
T: Sync,
impl<T, P> Sync for QueryResult<T, P> where
P: Sync,
T: Sync,