Trait ArchiveSqlLogic

Source
pub trait ArchiveSqlLogic {
    // Provided methods
    fn get_entities_to_archive<'life0, 'life1, 'life2, 'async_trait>(
        pool: &'life0 Pool<Postgres>,
        record_type: &'life1 RecordType,
        retention_period: &'life2 i32,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Entity>, SqlError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn get_data_to_archive<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'async_trait>(
        space: &'life0 str,
        name: &'life1 str,
        version: &'life2 str,
        begin_timestamp: &'life3 DateTime<Utc>,
        end_timestamp: &'life4 DateTime<Utc>,
        record_type: &'life5 RecordType,
        db_pool: &'life6 Pool<Postgres>,
    ) -> Pin<Box<dyn Future<Output = Result<ServerRecords, SqlError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait,
             'life5: 'async_trait,
             'life6: 'async_trait { ... }
    fn update_data_to_archived<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'async_trait>(
        space: &'life0 str,
        name: &'life1 str,
        version: &'life2 str,
        begin_timestamp: &'life3 DateTime<Utc>,
        end_timestamp: &'life4 DateTime<Utc>,
        record_type: &'life5 RecordType,
        db_pool: &'life6 Pool<Postgres>,
    ) -> Pin<Box<dyn Future<Output = Result<(), SqlError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait,
             'life5: 'async_trait,
             'life6: 'async_trait { ... }
}

Provided Methods§

Source

fn get_entities_to_archive<'life0, 'life1, 'life2, 'async_trait>( pool: &'life0 Pool<Postgres>, record_type: &'life1 RecordType, retention_period: &'life2 i32, ) -> Pin<Box<dyn Future<Output = Result<Vec<Entity>, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Function to get entities for archival

§Arguments
  • record_type - The type of record to get entities for
  • retention_period - The retention period to get entities for
Source

fn get_data_to_archive<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'async_trait>( space: &'life0 str, name: &'life1 str, version: &'life2 str, begin_timestamp: &'life3 DateTime<Utc>, end_timestamp: &'life4 DateTime<Utc>, record_type: &'life5 RecordType, db_pool: &'life6 Pool<Postgres>, ) -> Pin<Box<dyn Future<Output = Result<ServerRecords, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, 'life5: 'async_trait, 'life6: 'async_trait,

Function to get data for archival

§Arguments
  • record_type - The type of record to get data for
  • days - The number of days to get data for
§Returns
  • Result<ServerRecords, SqlError> - Result of the query
§Errors
  • SqlError - If the query fails
Source

fn update_data_to_archived<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'async_trait>( space: &'life0 str, name: &'life1 str, version: &'life2 str, begin_timestamp: &'life3 DateTime<Utc>, end_timestamp: &'life4 DateTime<Utc>, record_type: &'life5 RecordType, db_pool: &'life6 Pool<Postgres>, ) -> Pin<Box<dyn Future<Output = Result<(), SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, 'life5: 'async_trait, 'life6: 'async_trait,

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§