Implement delete

This commit is contained in:
Yuriy Dupyn 2024-02-05 21:50:42 +01:00
parent 997162c555
commit 9af6ad90f3
2 changed files with 10 additions and 6 deletions

View file

@ -247,7 +247,12 @@ impl <'cursor, T> WriteCursor<'cursor, T>
pub async fn delete_all_entries(&mut self, enable_garbage_collector: bool) -> Result<usize>
where T: Encode + Decode + Ord + Send + Sync + Clone
{
let count = todo!();
let mut count = 0;
while let Some(entry) = self.next_alive().await? {
count += 1;
self.mark_deleted_at(entry.file_position, false).await?
}
if enable_garbage_collector {
self.attempt_garbage_collection_if_necessary().await?;
}