Skip to content

Commit

Permalink
Add hasher method to ReadOnlyView
Browse files Browse the repository at this point in the history
  • Loading branch information
a1phyr committed May 15, 2024
1 parent 14393fa commit 6609921
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Item = (&K, &V)> {
self.iter_shards().flat_map(|shard| shard.iter())
}
Expand Down
4 changes: 4 additions & 0 deletions src/unsync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Item = (&K, &V)> {
self.map.iter()
}
Expand Down

0 comments on commit 6609921

Please sign in to comment.