Cache layer for tower::Services
[CacheLayer] is a tower Layer that provides caches for Services by using
another service to handle the cache. This allows the usage of asynchronous
and external caches.
Usage
use Infallible;
use ;
use ;
async
// Initialize the cache provider service
let lru_provider = new;
// Initialize the service
let my_service = service_fn;
// Wrap the service with CacheLayer.
let my_service = new
.layer
.service;
Creating cache providers
A cache provider is a [tower::Service] that takes a [ProviderRequest]
as request and returns a [ProviderResponse].