Implement Garbage Collection
This commit is contained in:
parent
1086b2fc5e
commit
f3fc67cbbc
4 changed files with 43 additions and 20 deletions
|
|
@ -100,6 +100,11 @@ where
|
|||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn reset(&mut self, data: BTreeMap<K, HashSet<V>>) -> Result<()> {
|
||||
self.data = data;
|
||||
self.sync_to_disk().await
|
||||
}
|
||||
|
||||
async fn append_to_file(&mut self, key: &K, value: &V) -> Result<()> {
|
||||
let mut encoded = Vec::new();
|
||||
encoded.extend(encode(key)?);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue