pub trait Cache {
type Read: AsyncBufRead + Unpin;
type Write: AsyncWrite + Unpin;
// Required methods
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 Url,
) -> Pin<Box<dyn Future<Output = Result<Option<Self::Read>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn insert<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 Url,
) -> Pin<Box<dyn Future<Output = Result<Self::Write>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}
Expand description
Resource caching layer
Required Associated Types§
sourcetype Read: AsyncBufRead + Unpin
type Read: AsyncBufRead + Unpin
Type returned by the Self::get method
sourcetype Write: AsyncWrite + Unpin
type Write: AsyncWrite + Unpin
Type returned by the Self::insert method
Required Methods§
sourcefn get<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 Url,
) -> Pin<Box<dyn Future<Output = Result<Option<Self::Read>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 Url,
) -> Pin<Box<dyn Future<Output = Result<Option<Self::Read>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns an read handle for the entry from the cache associated with a given url