Expand description
Cacheable response types and traits.
This module provides types for working with cacheable responses:
CacheableResponse- Trait for types that can be cachedCacheState- Freshness state of cached dataResponseCachePolicy- Type alias for response cache decisions
§CacheableResponse Trait
The CacheableResponse trait defines how response types are converted
to and from their cached representation. This allows responses to be
stored efficiently in cache backends.
§Cache States
Cached data can be in three states:
CacheState::Actual- Data is fresh and validCacheState::Stale- Data is usable but should be refreshedCacheState::Expired- Data is no longer valid
§Result Handling
This module provides a blanket implementation of CacheableResponse for
Result<T, E> where T: CacheableResponse. This allows error responses
to pass through uncached while successful responses are cached.
Enums§
- Cache
State - Freshness state of cached data.
Traits§
- Cacheable
Response - Trait for response types that can be cached.
Type Aliases§
- Response
Cache Policy - Cache policy for responses.