diff --git a/src/lib.rs b/src/lib.rs index be47ea2..4c56359 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -545,6 +545,21 @@ impl HConsign { Ok(init) } + /// Returns an iterator to the consign's contents + #[inline] + pub fn iter(&self) -> impl ExactSizeIterator { + self.table.keys() + } + + /// Determine if the consign contains an element + #[inline] + pub fn contains(&self, elem: &T) -> bool + where + S: BuildHasher, + { + self.table.contains_key(elem) + } + /// The number of elements stored, mostly for testing. #[inline] pub fn len(&self) -> usize {