Skip to main content

HttpCache

Trait HttpCache 

Source
pub trait HttpCache: Send {
    // Required methods
    fn get(&self, key: &CacheKey) -> Result<Option<CacheEntry>, CliError>;
    fn put(&self, key: &CacheKey, entry: CacheEntry) -> Result<(), CliError>;
}
Expand description

Trait for one-shot HTTP/parse caches.

Required Methods§

Source

fn get(&self, key: &CacheKey) -> Result<Option<CacheEntry>, CliError>

Lookup a key.

Source

fn put(&self, key: &CacheKey, entry: CacheEntry) -> Result<(), CliError>

Store a key.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§