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

BorrowingUnaryCallable

Defines safe readonly invocation borrowing one retained input item.

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

import std.iteration;

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

BorrowingUnaryCallable

pub concept BorrowingUnaryCallable<Self, T, R>

Defines safe readonly invocation borrowing one retained input item.

Authored objects provide public readonly Invoke; generated lambdas satisfy the authenticated canonical witness. The borrowed argument cannot authorize moving or mutating the payload. Exact result/access and safety are preserved. Concrete captures use ordinary lifecycle; no box, allocation, lock or backing retention is added. Serialize callback use when its backing requires it. Self: Concrete callback/environment type. T: Retained source payload type; reference payloads keep exact alias rules. R: Exact callback output type. Warning: Borrowed capture and output backing must remain valid through use.

BorrowingUnaryCallable.Invoke

requires readonly fn Invoke(Item: readonly T&) -> R;

Invokes a safe observer on readonly access to one live payload. Item: Retained item, borrowed synchronously and never implicitly copied. Return: Exact result with its original ownership/access requirements.

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