/// creates an empty [`Cache`] with a periodic scanner which identifies expired entries.
///
/// # Example
/// ```
/// use engine::store::Cache;
/// use std::time::Duration;
///
/// let scan_freq = Duration::from_secs(60);
///
/// let mut cache = Cache::create_with_scanner(scan_freq);
///
/// let key: &'static str = "key";
/// let value: &'static str = "value";
///
/// cache.insert(key, value, None);
///
/// assert_eq!(cache.get(&key), Some(&value));
/// ```
creates an empty [`Cache`] with a periodic scanner which identifies expired entries.
creates an empty [ ` Cache ` ] with a periodic scanner which identifies expired entries .
pub fn create_with_scanner(scan_freq: Duration) -> Self {
        Self {
            table: HashMap::new(),
            scan_freq: Some(scan_freq),
            created_at: SystemTime::now(),
            last_scan_at: None,
        }
    }
pub fn create_with_scanner ( scan_freq : Duration ) -> Self { Self { table : HashMap :: new ( ) , scan_freq : Some ( scan_freq ) , created_at : SystemTime :: now ( ) , last_scan_at : None , } }
creates an empty [`Cache`] with a periodic scanner which identifies expired entries.
creates an empty [ ` Cache ` ] with a periodic scanner which identifies expired entries .
scan_freq
Duration
example
```
use engine::store::Cache;
use std::time::Duration.

let scan_freq = Duration::from_secs(60).

let mut cache = Cache::create_with_scanner(scan_freq).

let key: &'static str = "key";
let value: &'static str = "value".

cache.insert(key, value, None).


` ` ` use engine :: store :: Cache ; use std :: time :: Duration . let scan_freq = Duration :: from_secs ( 60 ) . let mut cache = Cache :: create_with_scanner ( scan_freq ) . let key : & ' static str = " key " ; let value : & ' static str = " value " . cache . insert ( key value None ) .