mod.rs 256 B

123456789
  1. use crate::value::Value;
  2. use std::collections::{BTreeMap, HashMap};
  3. use std::sync::{Arc, RwLock};
  4. use tokio::time::Instant;
  5. pub struct Db {
  6. entries: Arc<RwLock<HashMap<String, Value>>>,
  7. expiration: Arc<RwLock<BTreeMap<(Instant, u64), String>>>,
  8. }