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

HashSetIterator

Borrows set keys readonly in unspecified bucket order.

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.

HashSetIterator

pub final class HashSetIterator<K> where K: Movable

Borrows set keys readonly in unspecified bucket order.

Full traversal costs O(capacity), allocates nothing and skips deleted/empty buckets. Exhaustion is permanent. The cursor retains no owner; structural mutation, move/destruction invalidate it and yielded key references. K: Movable stored key type, always yielded readonly.

HashSetIterator.Next

pub fn Next() -> K&?

Advances once and borrows the next stored key readonly. Return: Optional readonly key reference, or none permanently after exhaustion. Warning: May scan absent buckets; owner invalidation rules apply.

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