DeboaCache

Trait DeboaCache 

Source
pub trait DeboaCache {
    // Required methods
    fn get(&self, key: &str) -> Option<String>;
    fn set(&self, key: &str, value: &str);
    fn delete(&self, key: &str);
}
Expand description

A trait for cache implementations.

Required Methods§

Source

fn get(&self, key: &str) -> Option<String>

Get a value from the cache.

§Arguments
  • key - The key to get the value from.
§Returns
  • Option<String> - The value if it exists, None otherwise.
Source

fn set(&self, key: &str, value: &str)

Set a value in the cache.

§Arguments
  • key - The key to set the value for.
  • value - The value to set.
Source

fn delete(&self, key: &str)

Delete a value from the cache.

§Arguments
  • key - The key to delete the value for.

Implementors§