Skip to main content

Query

Trait Query 

Source
pub trait Query<A> {
    // Required methods
    fn prepare_mysql<'life0, 'async_trait>(
        connection: &'life0 mut MySqlConnection,
    ) -> Pin<Box<dyn Future<Output = Result<MySqlStatement>> + Send + 'async_trait>>
       where 'life0: 'async_trait;
    fn query_mysql<'a>(
        &'a self,
        statement: &'a MySqlStatement,
    ) -> Query<'a, MySql, MySqlArguments>;
    fn row_data_mysql(row: &MySqlRow) -> Result<A>;

    // Provided methods
    fn prepare<'life0, 'async_trait>(
        connection: &'life0 mut AnyConnection<'_>,
    ) -> Pin<Box<dyn Future<Output = Result<AnyStatement>> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait { ... }
    fn query<'a>(&'a self, statement: &'a AnyStatement) -> AnyQuery<'a> { ... }
    fn row_data(row: &AnyRow) -> Result<A> { ... }
}
Expand description

An interface for queries to allow converting them to various database implementations

Required Methods§

Source

fn prepare_mysql<'life0, 'async_trait>( connection: &'life0 mut MySqlConnection, ) -> Pin<Box<dyn Future<Output = Result<MySqlStatement>> + Send + 'async_trait>>
where 'life0: 'async_trait,

MySQL version of Query::prepare.

Source

fn query_mysql<'a>( &'a self, statement: &'a MySqlStatement, ) -> Query<'a, MySql, MySqlArguments>

MySQL version of Query::query.

Source

fn row_data_mysql(row: &MySqlRow) -> Result<A>

MySQL version of Query::row_data.

Provided Methods§

Source

fn prepare<'life0, 'async_trait>( connection: &'life0 mut AnyConnection<'_>, ) -> Pin<Box<dyn Future<Output = Result<AnyStatement>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

Prepare a statement to be later used by Query::query.

Source

fn query<'a>(&'a self, statement: &'a AnyStatement) -> AnyQuery<'a>

Get a query with all arguments bound already, ready to be fetched.

Source

fn row_data(row: &AnyRow) -> Result<A>

Gets the row data for a result row of this query

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§