From 66099212d285f58e93db32d39e8e62fbf362df98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20du=20Garreau?= Date: Wed, 15 May 2024 10:49:18 +0200 Subject: [PATCH] Add `hasher` method to `ReadOnlyView` --- src/sync.rs | 4 ++++ src/unsync.rs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/sync.rs b/src/sync.rs index 72d34a1..67001cd 100644 --- a/src/sync.rs +++ b/src/sync.rs @@ -818,6 +818,10 @@ impl<'a, K, V, S> ReadOnlyView<'a, K, V, S> { self.iter_shards().all(|s| s.is_empty()) } + pub fn hasher(&self) -> &S { + self.hasher + } + pub fn iter(&self) -> impl Iterator { self.iter_shards().flat_map(|shard| shard.iter()) } diff --git a/src/unsync.rs b/src/unsync.rs index 2c28bc0..51f9603 100644 --- a/src/unsync.rs +++ b/src/unsync.rs @@ -400,6 +400,10 @@ impl<'a, K, V, S> ReadOnlyView<'a, K, V, S> { self.map.is_empty() } + pub fn hasher(&self) -> &S { + self.hash_builder + } + pub fn iter(&self) -> impl Iterator { self.map.iter() }