pub trait CacheInvalidation: Send + Sync {
// Required methods
fn invalidate_policies<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn subscribe_to_invalidations<'life0, 'async_trait, F>(
&'life0 self,
callback: F,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>
where F: Fn() + Send + Sync + 'static + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Trait for cache invalidation mechanisms
Required Methods§
Sourcefn invalidate_policies<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn invalidate_policies<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Publish a cache invalidation event
Sourcefn subscribe_to_invalidations<'life0, 'async_trait, F>(
&'life0 self,
callback: F,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>
fn subscribe_to_invalidations<'life0, 'async_trait, F>( &'life0 self, callback: F, ) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>
Subscribe to cache invalidation events with a callback
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.