diff --git a/src/raw/mod.rs b/src/raw/mod.rs index d8deab5f50..1ff0135382 100644 --- a/src/raw/mod.rs +++ b/src/raw/mod.rs @@ -1470,6 +1470,17 @@ impl Iterator for RawIterRange { impl FusedIterator for RawIterRange {} /// Iterator which returns a raw pointer to every full bucket in the table. +/// +/// For maximum flexibility this iterator is not bound by a lifetime, but you +/// must observe several rules when using it: +/// - You must not free the hash table while iterating (including via growing/shrinking). +/// - It is fine to erase a bucket that has been yielded by the iterator. +/// - Erasing a bucket that has not yet been yielded by the iterator may still +/// result in the iterator yielding that bucket (unless `reflect_remove` is called). +/// - It is unspecified whether an element inserted after the iterator was +/// created will be yielded by that iterator (unless `reflect_insert` is called). +/// - The order in which the iterator yields bucket is unspecified and may +/// change in the future. pub struct RawIter { pub(crate) iter: RawIterRange, items: usize,