UnaryCallable
Defines one safe readonly invocation with exact input and result types.
Module std.iteration
import std.iteration;Public declaration contracts and authored examples. A page can document several related symbols. Implementation bodies are excluded.
UnaryCallable
pub concept UnaryCallable<Self, T, R>Defines one safe readonly invocation with exact input and result types.
Satisfaction is structural. Compiler-generated capturing lambdas use their existing method through an authenticated canonical witness; authored objects provide a public readonly Invoke. The concept introduces no dynamic box, allocation or runtime witness table. Capture ownership remains the concrete callable's contract; borrowed captures must outlive every invocation. Self: Concrete callback/environment type. T: Exact input type and reference access. R: Exact output type and reference access. Warning: Safety and calling convention remain exact; unsafe callbacks cannot erase authorization.
UnaryCallable.Invoke
requires readonly fn Invoke(Item: T) -> R;Invokes the exact safe unary callback through readonly environment access. Item: Exact input; owning values transfer and references remain aliases. Return: Exact output; any borrowed result retains the callback's backing restrictions.