Implement delete
This commit is contained in:
parent
997162c555
commit
9af6ad90f3
2 changed files with 10 additions and 6 deletions
|
|
@ -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?;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue