pub trait CacheManager: Send + Sync {
// Required methods
fn get_cached_proto<'life0, 'life1, 'async_trait>(
&'life0 self,
uri: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<CachedProto>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn cache_proto<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
uri: &'life1 str,
proto: &'life2 [ProtoFile],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn invalidate_cache<'life0, 'life1, 'async_trait>(
&'life0 self,
uri: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn clear_cache<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_cache_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<CacheStats>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
依赖缓存管理
Required Methods§
Sourcefn get_cached_proto<'life0, 'life1, 'async_trait>(
&'life0 self,
uri: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<CachedProto>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_cached_proto<'life0, 'life1, 'async_trait>(
&'life0 self,
uri: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<CachedProto>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
获取缓存的Proto
Sourcefn cache_proto<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
uri: &'life1 str,
proto: &'life2 [ProtoFile],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn cache_proto<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
uri: &'life1 str,
proto: &'life2 [ProtoFile],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
缓存Proto文件
Sourcefn invalidate_cache<'life0, 'life1, 'async_trait>(
&'life0 self,
uri: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn invalidate_cache<'life0, 'life1, 'async_trait>(
&'life0 self,
uri: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
失效缓存
Sourcefn clear_cache<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn clear_cache<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
清理缓存
Sourcefn get_cache_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<CacheStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_cache_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<CacheStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
获取缓存统计