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

ConsumingBinaryCallable

Defines a safe readonly reducer with an exact owned accumulator with explicit consuming access.

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.iteration

import std.iteration;

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

ConsumingBinaryCallable

pub concept ConsumingBinaryCallable<Self, A, T, R>

Defines a safe readonly reducer with an exact owned accumulator with explicit consuming access.

Authored objects supply public readonly Invoke; generated capturing lambdas use the authenticated canonical witness. No callback box or allocation is introduced. Concrete capture lifecycle remains ordinary; borrowed captures must survive every invocation. External synchronization is required whenever callback backing is shared with writers. Exact modes and safety are preserved. Self: Concrete callback/environment type. A: Accumulator type with its exact ownership/access category. T: Exact input item value/reference type. R: Exact result type and reference access. Warning: Does not extend borrowed backing lifetime or erase unsafe authorization.

ConsumingBinaryCallable.Invoke

requires readonly fn Invoke(Accumulator: mut A&&, Item: T) -> R;

Reduces one item through safe readonly environment access. Accumulator: Previous state; follows the declared passing mode. Item: Exact input item; owning payloads transfer, references alias. Return: Exact replacement; borrowed results retain their validity boundary.

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