Trait TransactionExtensions

Source
pub trait TransactionExtensions {
    // Required methods
    fn insert<'life0, 'async_trait, T, P>(
        &'life0 self,
        entity: T,
    ) -> Pin<Box<dyn Future<Output = Result<P, Error>> + Send + 'async_trait>>
       where T: SqlCommand + SqlParams + Send + Sync + 'static + 'async_trait,
             P: 'async_trait + for<'a> FromSql<'a> + Send + Sync,
             Self: 'async_trait,
             'life0: 'async_trait;
    fn update<'life0, 'async_trait, T>(
        &'life0 self,
        entity: T,
    ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>
       where T: SqlCommand + UpdateParams + Send + Sync + 'static + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait;
    fn delete<'life0, 'async_trait, T>(
        &'life0 self,
        entity: T,
    ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>
       where T: SqlCommand + SqlParams + Send + Sync + 'static + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait;
    fn fetch<'life0, 'async_trait, P, R>(
        &'life0 self,
        params: P,
    ) -> Pin<Box<dyn Future<Output = Result<R, Error>> + Send + 'async_trait>>
       where P: SqlQuery<R> + SqlParams + Send + Sync + 'static + 'async_trait,
             R: FromRow + Send + Sync + 'static + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait;
    fn fetch_all<'life0, 'async_trait, P, R>(
        &'life0 self,
        params: P,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<R>, Error>> + Send + 'async_trait>>
       where P: SqlQuery<R> + SqlParams + Send + Sync + 'static + 'async_trait,
             R: FromRow + Send + Sync + 'static + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Transaction extension trait for additional query operations

Required Methods§

Source

fn insert<'life0, 'async_trait, T, P>( &'life0 self, entity: T, ) -> Pin<Box<dyn Future<Output = Result<P, Error>> + Send + 'async_trait>>
where T: SqlCommand + SqlParams + Send + Sync + 'static + 'async_trait, P: 'async_trait + for<'a> FromSql<'a> + Send + Sync, Self: 'async_trait, 'life0: 'async_trait,

Inserts a new record into the database within a transaction

Source

fn update<'life0, 'async_trait, T>( &'life0 self, entity: T, ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>
where T: SqlCommand + UpdateParams + Send + Sync + 'static + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Updates an existing record in the database within a transaction

Source

fn delete<'life0, 'async_trait, T>( &'life0 self, entity: T, ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>
where T: SqlCommand + SqlParams + Send + Sync + 'static + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Deletes a record from the database within a transaction

Source

fn fetch<'life0, 'async_trait, P, R>( &'life0 self, params: P, ) -> Pin<Box<dyn Future<Output = Result<R, Error>> + Send + 'async_trait>>
where P: SqlQuery<R> + SqlParams + Send + Sync + 'static + 'async_trait, R: FromRow + Send + Sync + 'static + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Retrieves a single record from the database within a transaction

Source

fn fetch_all<'life0, 'async_trait, P, R>( &'life0 self, params: P, ) -> Pin<Box<dyn Future<Output = Result<Vec<R>, Error>> + Send + 'async_trait>>
where P: SqlQuery<R> + SqlParams + Send + Sync + 'static + 'async_trait, R: FromRow + Send + Sync + 'static + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Retrieves multiple records from the database within a transaction

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§