ConsumingBinaryCallable
Defines a safe readonly reducer with an exact owned accumulator with explicit consuming access.
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.