pub trait CacheableError {
// Required methods
fn is_cached(&self) -> bool;
fn cache_miss() -> Self;
fn cache_error(reason: String) -> Self;
}Expand description
Trait for errors that can indicate whether they represent a cached response and provide a way to create cache-related errors.
Required Methods§
Sourcefn is_cached(&self) -> bool
fn is_cached(&self) -> bool
Returns true if this error indicates the resource should be served from cache. Typically true for HTTP 304 Not Modified responses.
Sourcefn cache_miss() -> Self
fn cache_miss() -> Self
Create an error for when cached data is requested but not available.
Sourcefn cache_error(reason: String) -> Self
fn cache_error(reason: String) -> Self
Cache error
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.