RelationshipLoader

Trait RelationshipLoader 

Source
pub trait RelationshipLoader<T>: Send + Sync {
    // Required methods
    fn load<'life0, 'life1, 'async_trait>(
        &'life0 self,
        pool: &'life1 Pool<Postgres>,
    ) -> Pin<Box<dyn Future<Output = ModelResult<T>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn reload<'life0, 'life1, 'async_trait>(
        &'life0 self,
        pool: &'life1 Pool<Postgres>,
    ) -> Pin<Box<dyn Future<Output = ModelResult<T>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Trait for loading relationships dynamically

Required Methods§

Source

fn load<'life0, 'life1, 'async_trait>( &'life0 self, pool: &'life1 Pool<Postgres>, ) -> Pin<Box<dyn Future<Output = ModelResult<T>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Load the relationship from the database

Source

fn reload<'life0, 'life1, 'async_trait>( &'life0 self, pool: &'life1 Pool<Postgres>, ) -> Pin<Box<dyn Future<Output = ModelResult<T>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Reload the relationship, bypassing cache

Implementors§