Struct sqlx_core_oldapi::query::Map  
source · 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§
source§impl<'q, DB, F, O, A> Map<'q, DB, F, A>where
    DB: Database,
    F: FnMut(DB::Row) -> Result<O, Error> + Send,
    O: Send + Unpin,
    A: 'q + Send + IntoArguments<'q, DB>,
 
impl<'q, DB, F, O, A> Map<'q, DB, F, A>where DB: Database, F: FnMut(DB::Row) -> Result<O, Error> + Send, O: Send + Unpin, A: 'q + Send + IntoArguments<'q, DB>,
sourcepub fn map<G, P>(
    self,
    g: G
) -> Map<'q, DB, impl FnMut(DB::Row) -> Result<P, Error> + Send, A>where
    G: FnMut(O) -> P + Send,
    P: Unpin,
 
pub fn map<G, P>( self, g: G ) -> Map<'q, DB, impl FnMut(DB::Row) -> Result<P, Error> + Send, A>where G: FnMut(O) -> P + Send, P: Unpin,
sourcepub fn try_map<G, P>(
    self,
    g: G
) -> Map<'q, DB, impl FnMut(DB::Row) -> Result<P, Error> + Send, A>where
    G: FnMut(O) -> Result<P, Error> + Send,
    P: Unpin,
 
pub fn try_map<G, P>( self, g: G ) -> Map<'q, DB, impl FnMut(DB::Row) -> Result<P, Error> + Send, A>where G: FnMut(O) -> Result<P, Error> + Send, P: Unpin,
sourcepub fn fetch<'e, 'c: 'e, E>(
    self,
    executor: E
) -> BoxStream<'e, Result<O, Error>>where
    E: 'e + Executor<'c, Database = DB>,
    DB: 'e,
    F: 'e,
    O: 'e,
    'q: 'e,
 
pub fn fetch<'e, 'c: 'e, E>( self, executor: E ) -> BoxStream<'e, Result<O, Error>>where E: 'e + Executor<'c, Database = DB>, DB: 'e, F: 'e, O: 'e, 'q: 'e,
Execute the query and return the generated results as a stream.
sourcepub fn fetch_many<'e, 'c: 'e, E>(
    self,
    executor: E
) -> BoxStream<'e, Result<Either<DB::QueryResult, O>, Error>>where
    E: 'e + Executor<'c, Database = DB>,
    DB: 'e,
    F: 'e,
    O: 'e,
    'q: 'e,
 
pub fn fetch_many<'e, 'c: 'e, E>( self, executor: E ) -> BoxStream<'e, Result<Either<DB::QueryResult, O>, Error>>where E: 'e + Executor<'c, Database = DB>, DB: 'e, F: 'e, O: 'e, 'q: 'e,
Execute multiple queries and return the generated results as a stream from each query, in a stream.
sourcepub async fn fetch_all<'e, 'c: 'e, E>(
    self,
    executor: E
) -> Result<Vec<O>, Error>where
    E: 'e + Executor<'c, Database = DB>,
    DB: 'e,
    F: 'e,
    O: 'e,
    'q: 'e,
 
pub async fn fetch_all<'e, 'c: 'e, E>( self, executor: E ) -> Result<Vec<O>, Error>where E: 'e + Executor<'c, Database = DB>, DB: 'e, F: 'e, O: 'e, 'q: 'e,
Execute the query and return all the generated results, collected into a Vec.
Trait Implementations§
source§impl<'q, DB, F: Send, A> Execute<'q, DB> for Map<'q, DB, F, A>where
    DB: Database,
    A: IntoArguments<'q, DB> + Send,
 
impl<'q, DB, F: Send, A> Execute<'q, DB> for Map<'q, DB, F, A>where DB: Database, A: IntoArguments<'q, DB> + Send,
source§fn statement(&self) -> Option<&<DB as HasStatement<'q>>::Statement>
 
fn statement(&self) -> Option<&<DB as HasStatement<'q>>::Statement>
Gets the previously cached statement, if available.
source§fn take_arguments(&mut self) -> Option<<DB as HasArguments<'q>>::Arguments>
 
fn take_arguments(&mut self) -> Option<<DB as HasArguments<'q>>::Arguments>
Returns the arguments to be bound against the query string. Read more
source§fn persistent(&self) -> bool
 
fn persistent(&self) -> bool
Returns 
true if the statement should be cached.Auto Trait Implementations§
impl<'q, DB, F, A> RefUnwindSafe for Map<'q, DB, F, A>where A: RefUnwindSafe, DB: RefUnwindSafe, F: RefUnwindSafe, <DB as HasStatement<'q>>::Statement: RefUnwindSafe,
impl<'q, DB, F, A> Send for Map<'q, DB, F, A>where A: Send, F: Send,
impl<'q, DB, F, A> Sync for Map<'q, DB, F, A>where A: Sync, DB: Sync, F: Sync,
impl<'q, DB, F, A> Unpin for Map<'q, DB, F, A>where A: Unpin, DB: Unpin, F: Unpin,
impl<'q, DB, F, A> UnwindSafe for Map<'q, DB, F, A>where A: UnwindSafe, DB: UnwindSafe, F: UnwindSafe, <DB as HasStatement<'q>>::Statement: RefUnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more