Skip to main content

CacheInvalidator

Trait CacheInvalidator 

Source
pub trait CacheInvalidator: Send + Sync {
    // Required methods
    fn invalidate<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        ctx: &'life1 Context,
        caches: &'life2 [CacheIdent],
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn invalidate_all(&self) -> Result<()>;

    // Provided method
    fn name(&self) -> &'static str { ... }
}

Required Methods§

Source

fn invalidate<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 Context, caches: &'life2 [CacheIdent], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn invalidate_all(&self) -> Result<()>

Invalidates every cache entry owned by this invalidator.

This method is required so each implementer explicitly decides how full-cache invalidation should behave. Implementations that intentionally do nothing must document why a no-op is safe.

Provided Methods§

Source

fn name(&self) -> &'static str

Implementors§