Snapshot · Oct 24, 2026 · Frozen documentation
Formattable
Defines the compile-time-only structural contract used by interpolation.
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.format
import std.format;Public declaration contracts and authored examples. A page can document several related symbols. Implementation bodies are excluded.
Formattable
pub concept Formattable<Self>Defines the compile-time-only structural contract used by interpolation.
A satisfying type exposes the exact free FormatTo operation below. The compiler selects a normalized witness statically; no concept object, erased descriptor, allocation-failure channel, or runtime dispatch is introduced.
Example
module example.formattable;
from std.format import Formattable;
fn Main() -> i32 {
// Interpolation proves i32 satisfies the imported structural concept.
let Text: str = $"value={42}";
return 0;
}Documentation snapshot: October 24, 2026 About versions ↗