Add `CachingShardStore` for batching writes to a backend `ShardStore`

This commit is contained in:
Jack Grigg 2023-07-14 01:32:19 +00:00
parent 84d652db22
commit 2715a24943
2 changed files with 1259 additions and 0 deletions

1253
shardtree/src/caching.rs Normal file

File diff suppressed because it is too large Load Diff

View File

@ -19,6 +19,7 @@ pub use self::prunable::{
IncompleteAt, InsertionError, LocatedPrunableTree, PrunableTree, QueryError, RetentionFlags,
};
pub mod caching;
pub mod memory;
#[cfg(any(bench, test, feature = "test-dependencies"))]
@ -364,6 +365,11 @@ impl<
}
}
/// Consumes this tree and returns its underlying `ShardStore`.
pub fn into_store(self) -> S {
self.store
}
/// Returns the root address of the tree.
pub fn root_addr() -> Address {
Address::from_parts(Level::from(DEPTH), 0)