Under heavy development. This site describes the intended 1.0 language. Current features and performance vary. Development status
Sn50SnThe SnAPI programming language
0.2.0 Preview 1 · Frozen documentation

HashMapIterator

Scans borrowed map buckets as readonly entry views.

Sn is under heavy development. Reference extracted from this release’s bundled standard library. Public API examples are not an exhaustive compatibility test. Read the matching release guide for tested workflows and limitations. 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