pub trait HandleHit {
// Required methods
fn read_body<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn finish<'life0, 'life1, 'async_trait>(
self: Box<Self>,
storage: &'static (dyn Storage + Sync),
key: &'life0 CacheKey,
trace: &'life1 SpanHandle,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn as_any(&self) -> &(dyn Any + Send + Sync);
// Provided methods
fn can_seek(&self) -> bool { ... }
fn seek(&mut self, _start: usize, _end: Option<usize>) -> Result<()> { ... }
}
Expand description
Cache hit handling trait
Required Methods§
Sourcefn read_body<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn read_body<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Read cached body
Return None
when no more body to read.
Sourcefn finish<'life0, 'life1, 'async_trait>(
self: Box<Self>,
storage: &'static (dyn Storage + Sync),
key: &'life0 CacheKey,
trace: &'life1 SpanHandle,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn finish<'life0, 'life1, 'async_trait>(
self: Box<Self>,
storage: &'static (dyn Storage + Sync),
key: &'life0 CacheKey,
trace: &'life1 SpanHandle,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Finish the current cache hit