Skip to main content

Observer

Trait Observer 

Source
pub trait Observer<T>: Send + Sync {
    // Provided methods
    fn saving<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        _model: &'life1 mut T,
        _pool: &'life2 DatabasePool,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: 'async_trait { ... }
    fn saved<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        _model: &'life1 T,
        _pool: &'life2 DatabasePool,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: 'async_trait { ... }
    fn creating<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        _model: &'life1 mut T,
        _pool: &'life2 DatabasePool,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: 'async_trait { ... }
    fn created<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        _model: &'life1 T,
        _pool: &'life2 DatabasePool,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: 'async_trait { ... }
    fn updating<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        _model: &'life1 mut T,
        _pool: &'life2 DatabasePool,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: 'async_trait { ... }
    fn updated<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        _model: &'life1 T,
        _pool: &'life2 DatabasePool,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: 'async_trait { ... }
    fn deleting<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        _model: &'life1 T,
        _pool: &'life2 DatabasePool,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: 'async_trait { ... }
    fn deleted<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        _model: &'life1 T,
        _pool: &'life2 DatabasePool,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: 'async_trait { ... }
}
Expand description

Trait untuk Observer mandiri yang mengamati model dari class terpisah (Separation of Concerns).

Mirip dengan UserObserver pada Laravel Eloquent.

Provided Methods§

Source

fn saving<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _model: &'life1 mut T, _pool: &'life2 DatabasePool, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Source

fn saved<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _model: &'life1 T, _pool: &'life2 DatabasePool, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Source

fn creating<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _model: &'life1 mut T, _pool: &'life2 DatabasePool, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Source

fn created<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _model: &'life1 T, _pool: &'life2 DatabasePool, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Source

fn updating<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _model: &'life1 mut T, _pool: &'life2 DatabasePool, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Source

fn updated<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _model: &'life1 T, _pool: &'life2 DatabasePool, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Source

fn deleting<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _model: &'life1 T, _pool: &'life2 DatabasePool, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Source

fn deleted<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _model: &'life1 T, _pool: &'life2 DatabasePool, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§