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

DurationDestination

Requires exact target-type construction from exact integer or finite IEEE time facts.

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

import std.time;

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

DurationDestination

pub concept DurationDestination<Self>

Requires exact target-type construction from exact integer or finite IEEE time facts.

This compile-time structural protocol preserves caller-selected duration type and unit without a runtime witness or implicit nominal conversion. Implementors must check representation range and honor Exact/Floor/Ceil/NearestEven semantics. Finite error paths must never produce an endless duration. Self: Concrete destination duration type.

DurationDestination.ConvertMagnitude

requires static fn ConvertMagnitude(Value: readonly DurationMagnitude&,
        Period: DurationPeriod, Rounding: DurationRounding) -> Result<Self, DurationError>;

Converts exact count facts from an exact source period into this target. Value: Exact source sign/magnitude, borrowed only for this call. Period: Positive reduced source period. Rounding: Explicit precision selection. Return: Checked destination or finite period/precision/range error.

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