pub struct Map<'q, DB: Database, F, A> { /* private fields */ }
Expand description

SQL query that will map its results to owned Rust types.

Returned by Query::try_map, query!(), etc. Has most of the same methods as Query but the return types are changed to reflect the mapping. However, there is no equivalent of Query::execute as it doesn’t make sense to map the result type and then ignore it.

Query::bind is also omitted; stylistically we recommend placing your .bind() calls before .try_map(). This is also to prevent adding superfluous binds to the result of query!() et al.

Implementations

Map each row in the result to another type.

See try_map for a fallible version of this method.

The query_as method will construct a mapped query using a FromRow implementation.

Map each row in the result to another type.

The query_as method will construct a mapped query using a FromRow implementation.

Execute the query and return the generated results as a stream.

Execute multiple queries and return the generated results as a stream from each query, in a stream.

Execute the query and return all the generated results, collected into a Vec.

Execute the query and returns exactly one row.

Execute the query and returns at most one row.

Trait Implementations

Gets the SQL that will be executed.

Gets the previously cached statement, if available.

Returns the arguments to be bound against the query string. Read more

Returns true if the statement should be cached.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.