Under heavy development. This site describes the intended 1.0 language. Current features and performance vary. Development status
Sn50SnThe SnAPI programming language
Development · Evolving reference

HashMapIterator

Scans borrowed map buckets as readonly entry views.

Sn is under heavy development. This reference includes the intended 1.0 design; features may be incomplete in the current compiler. Read the status →

Module std.collections

import std.collections;

Public declaration contracts and authored examples. A page can document several related symbols. Implementation bodies are excluded.

HashMapIterator

pub final class HashMapIterator<K, V> where K: Movable where V: Movable

Scans borrowed map buckets as readonly entry views.

Full traversal costs O(capacity), skipping empty/deleted slots without allocation. Bucket order is unspecified. Exhaustion is permanent. The cursor retains no owner; structural mutation, move/destruction invalidate it and yielded views. K: Movable stored key type, always borrowed readonly. V: Movable stored value type.

HashMapIterator.Next

pub fn Next() -> HashMapEntryView<K, V>?

Scans to the next occupied bucket and borrows its entry. Return: Optional entry view, or none permanently after all buckets are scanned. Warning: Next can scan O(capacity) absent buckets; owner invalidation rules apply.

Documentation snapshot: October 24, 2026 About versions ↗
Searching Development · language & standard library