[][src]Struct mysql_async::QueryResult

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]

pub fn last_insert_id(&self) -> Option<u64>[src]

Last insert id (if not 0).

pub fn affected_rows(&self) -> u64[src]

Value of affected_rows returned from a server.

pub fn is_empty(&self) -> bool[src]

true 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]

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]

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]

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]

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]

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]

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]

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]

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]

Returns future that will drop this query result end resolve to a wrapped Queryable.

pub fn columns_ref(&self) -> &[Column][src]

Returns reference to columns in this query result.

pub fn columns(&self) -> Option<Arc<Vec<Column>>>[src]

Returns copy of columns of this query result.

Auto Trait Implementations

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

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same for T

type Output = T

Should always be Self

impl<T> Erased for T