diff options
Diffstat (limited to 'src/db/lib.rs')
-rw-r--r-- | src/db/lib.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/db/lib.rs b/src/db/lib.rs index 5304c195..22bd9364 100644 --- a/src/db/lib.rs +++ b/src/db/lib.rs @@ -178,6 +178,10 @@ impl Tree { pub fn len(&self) -> Result<usize> { self.0.len(self.1) } + #[inline] + pub fn fast_len(&self) -> Result<Option<usize>> { + self.0.fast_len(self.1) + } #[inline] pub fn first(&self) -> Result<Option<(Value, Value)>> { @@ -320,6 +324,9 @@ pub(crate) trait IDb: Send + Sync { fn get(&self, tree: usize, key: &[u8]) -> Result<Option<Value>>; fn len(&self, tree: usize) -> Result<usize>; + fn fast_len(&self, _tree: usize) -> Result<Option<usize>> { + Ok(None) + } fn insert(&self, tree: usize, key: &[u8], value: &[u8]) -> Result<Option<Value>>; fn remove(&self, tree: usize, key: &[u8]) -> Result<Option<Value>>; |