Skip to main content

CheckClient

Trait CheckClient 

Source
pub trait CheckClient: Sync {
    // Required methods
    fn query<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        sql: &'life1 str,
        params: &'life2 [&'life3 (dyn ToSql + Sync)],
    ) -> Pin<Box<dyn Future<Output = CheckResult<Vec<Row>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn query_one<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        sql: &'life1 str,
        params: &'life2 [&'life3 (dyn ToSql + Sync)],
    ) -> Pin<Box<dyn Future<Output = CheckResult<Row>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn execute<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        sql: &'life1 str,
        params: &'life2 [&'life3 (dyn ToSql + Sync)],
    ) -> Pin<Box<dyn Future<Output = CheckResult<u64>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
}
Expand description

A trait for types that can execute PostgreSQL queries.

This is implemented for tokio_postgres::Client, tokio_postgres::Transaction, and connection pool clients.

Required Methods§

Source

fn query<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, sql: &'life1 str, params: &'life2 [&'life3 (dyn ToSql + Sync)], ) -> Pin<Box<dyn Future<Output = CheckResult<Vec<Row>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Execute a query and return all rows.

Source

fn query_one<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, sql: &'life1 str, params: &'life2 [&'life3 (dyn ToSql + Sync)], ) -> Pin<Box<dyn Future<Output = CheckResult<Row>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Execute a query and return exactly one row.

Source

fn execute<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, sql: &'life1 str, params: &'life2 [&'life3 (dyn ToSql + Sync)], ) -> Pin<Box<dyn Future<Output = CheckResult<u64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Execute a statement and return the number of affected rows.

Implementations on Foreign Types§

Source§

impl CheckClient for Client

Source§

fn query<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, sql: &'life1 str, params: &'life2 [&'life3 (dyn ToSql + Sync)], ) -> Pin<Box<dyn Future<Output = CheckResult<Vec<Row>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source§

fn query_one<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, sql: &'life1 str, params: &'life2 [&'life3 (dyn ToSql + Sync)], ) -> Pin<Box<dyn Future<Output = CheckResult<Row>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source§

fn execute<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, sql: &'life1 str, params: &'life2 [&'life3 (dyn ToSql + Sync)], ) -> Pin<Box<dyn Future<Output = CheckResult<u64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source§

impl<'a> CheckClient for Transaction<'a>

Source§

fn query<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, sql: &'life1 str, params: &'life2 [&'life3 (dyn ToSql + Sync)], ) -> Pin<Box<dyn Future<Output = CheckResult<Vec<Row>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source§

fn query_one<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, sql: &'life1 str, params: &'life2 [&'life3 (dyn ToSql + Sync)], ) -> Pin<Box<dyn Future<Output = CheckResult<Row>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source§

fn execute<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, sql: &'life1 str, params: &'life2 [&'life3 (dyn ToSql + Sync)], ) -> Pin<Box<dyn Future<Output = CheckResult<u64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Implementors§