pub trait CacheStatusExt {
type Config;
// Required method
fn cache_status(&mut self, status: CacheStatus, config: &Self::Config);
}Expand description
Extension trait for enriching responses with cache status information.
This trait provides a protocol-agnostic way to attach cache status metadata to responses. Each protocol (HTTP, gRPC, etc.) implements this trait with its own configuration type.
§Example
ⓘ
use hitbox_core::{CacheStatus, CacheStatusExt};
// For HTTP responses (implemented in hitbox-http)
response.cache_status(CacheStatus::Hit, &header_name);Required Associated Types§
Required Methods§
Sourcefn cache_status(&mut self, status: CacheStatus, config: &Self::Config)
fn cache_status(&mut self, status: CacheStatus, config: &Self::Config)
Applies cache status information to the response.