Skip to main content

CacheableError

Trait CacheableError 

Source
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§

Source

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.

Source

fn cache_miss() -> Self

Create an error for when cached data is requested but not available.

Source

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.

Implementors§