···5050 total_size += size;
5151 }
5252 }
5353-5454- // clean up the disk store (drop tables etc)
5555- driver.reset_store().await?;
5653 }
5754 };
5855 println!("sum of size of all records: {total_size}");
···446446 /// println!("{rkey}: size={}", record.len());
447447 /// }
448448 /// }
449449- /// let store = disk_driver.reset_store().await?;
450449 /// # Ok(())
451450 /// # }
452451 /// ```
···559558 /// }
560559 ///
561560 /// }
562562- /// let store = join.await?.reset_store().await?;
563561 /// # Ok(())
564562 /// # }
565563 /// ```
···581579 });
582580583581 (rx, chan_task)
584584- }
585585-586586- /// Reset the disk storage so it can be reused. You must call this.
587587- ///
588588- /// Ideally we'd put this in an `impl Drop`, but since it makes blocking
589589- /// calls, that would be risky in an async context. For now you just have to
590590- /// carefully make sure you call it.
591591- ///
592592- /// The sqlite store is returned, so it can be reused for another
593593- /// `DiskDriver`.
594594- pub async fn reset_store(mut self) -> Result<DiskStore, DriveError> {
595595- let BigState { store, .. } = self.state.take().expect("valid state");
596596- Ok(store.reset().await?)
597582 }
598583}
-3
src/lib.rs
···5353 total_size += size;
5454 }
5555 }
5656-5757- // clean up the disk store (drop tables etc)
5858- driver.reset_store().await?;
5956 }
6057};
6158println!("sum of size of all records: {total_size}");