Trait deno_cache::Cache
source · pub trait Cache: Clone + 'static {
type CachePutResourceType: Resource;
// Required methods
fn storage_open<'life0, 'async_trait>(
&'life0 self,
cache_name: String
) -> Pin<Box<dyn Future<Output = Result<i64, AnyError>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn storage_has<'life0, 'async_trait>(
&'life0 self,
cache_name: String
) -> Pin<Box<dyn Future<Output = Result<bool, AnyError>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn storage_delete<'life0, 'async_trait>(
&'life0 self,
cache_name: String
) -> Pin<Box<dyn Future<Output = Result<bool, AnyError>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn put_create<'life0, 'async_trait>(
&'life0 self,
request_response: CachePutRequest
) -> Pin<Box<dyn Future<Output = Result<Option<Rc<Self::CachePutResourceType>>, AnyError>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn put_finish<'life0, 'async_trait>(
&'life0 self,
resource: Rc<Self::CachePutResourceType>
) -> Pin<Box<dyn Future<Output = Result<(), AnyError>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn match<'life0, 'async_trait>(
&'life0 self,
request: CacheMatchRequest
) -> Pin<Box<dyn Future<Output = Result<Option<(CacheMatchResponseMeta, Option<Rc<dyn Resource>>)>, AnyError>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete<'life0, 'async_trait>(
&'life0 self,
request: CacheDeleteRequest
) -> Pin<Box<dyn Future<Output = Result<bool, AnyError>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Required Associated Types§
Required Methods§
fn storage_open<'life0, 'async_trait>( &'life0 self, cache_name: String ) -> Pin<Box<dyn Future<Output = Result<i64, AnyError>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
fn storage_has<'life0, 'async_trait>( &'life0 self, cache_name: String ) -> Pin<Box<dyn Future<Output = Result<bool, AnyError>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
fn storage_delete<'life0, 'async_trait>( &'life0 self, cache_name: String ) -> Pin<Box<dyn Future<Output = Result<bool, AnyError>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
sourcefn put_create<'life0, 'async_trait>(
&'life0 self,
request_response: CachePutRequest
) -> Pin<Box<dyn Future<Output = Result<Option<Rc<Self::CachePutResourceType>>, AnyError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put_create<'life0, 'async_trait>( &'life0 self, request_response: CachePutRequest ) -> Pin<Box<dyn Future<Output = Result<Option<Rc<Self::CachePutResourceType>>, AnyError>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Create a put request.
sourcefn put_finish<'life0, 'async_trait>(
&'life0 self,
resource: Rc<Self::CachePutResourceType>
) -> Pin<Box<dyn Future<Output = Result<(), AnyError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put_finish<'life0, 'async_trait>( &'life0 self, resource: Rc<Self::CachePutResourceType> ) -> Pin<Box<dyn Future<Output = Result<(), AnyError>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Complete a put request.