Cacher

Trait Cacher 

Source
pub trait Cacher {
    // Required methods
    fn read(&mut self, url: &str) -> Result<Option<String>, HandlerError>;
    fn write(&mut self, url: &str, content: &str) -> Result<(), HandlerError>;

    // Provided method
    fn get_file_path(&self, _url: &str) -> Result<Option<PathBuf>, HandlerError> { ... }
}
Expand description

A system for reading and writing to a cache for URL based configurations.

Required Methods§

Source

fn read(&mut self, url: &str) -> Result<Option<String>, HandlerError>

Read content from the cache store.

Source

fn write(&mut self, url: &str, content: &str) -> Result<(), HandlerError>

Write the provided content to the cache store.

Provided Methods§

Source

fn get_file_path(&self, _url: &str) -> Result<Option<PathBuf>, HandlerError>

If the content was cached to the local file system, return the absolute path.

Implementors§