pub struct ResponseCache { /* private fields */ }
Expand description
Response cache specifically optimized for HTTP responses
Implementations§
Source§impl ResponseCache
impl ResponseCache
Sourcepub fn generate_key(
method: &str,
path: &str,
query: &str,
headers: &HashMap<String, String>,
) -> String
pub fn generate_key( method: &str, path: &str, query: &str, headers: &HashMap<String, String>, ) -> String
Generate cache key from request parameters
Sourcepub async fn cache_response(&self, key: String, response: CachedResponse)
pub async fn cache_response(&self, key: String, response: CachedResponse)
Cache a response
Sourcepub async fn get_response(&self, key: &str) -> Option<CachedResponse>
pub async fn get_response(&self, key: &str) -> Option<CachedResponse>
Get cached response
Sourcepub async fn stats(&self) -> CacheStats
pub async fn stats(&self) -> CacheStats
Get cache statistics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ResponseCache
impl !RefUnwindSafe for ResponseCache
impl Send for ResponseCache
impl Sync for ResponseCache
impl Unpin for ResponseCache
impl !UnwindSafe for ResponseCache
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more