Under heavy development. This site describes the intended 1.0 language. Current features and performance vary. Development status
Sn50SnThe SnAPI programming language
Snapshot · Oct 24, 2026 · Frozen documentation

RwLockState

Publishes fully initialized native/payload ownership.

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

import std.sync;

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

pub init(Word: usize, mut Value: T)

pub init(Word: usize, mut Value: T)

Publishes fully initialized native/payload ownership. Word: Created unique native word. Value: Owned payload.

pub init(Source: readonly Self&) = delete;

pub init(Source: readonly Self&) = delete;

Rejects duplicating native/payload ownership. Source: Existing state.

pub init(Source: mut Self&&)

pub init(Source: mut Self&&)

Moves state and recomputes its new payload address before shared publication. Source: State left with no native word.

pub Word: usize

pub Word: usize

Observes private native ownership without exposing it publicly.

BorrowValue

pub readonly fn BorrowValue() -> mut T&

Borrows interior payload only while an acquired native guard retains this state. Return: Guard-authorized reference, invalid at unlock.

TakeValue

pub fn TakeValue() -> T

Recovers the uninserted payload after shared allocation failed. Return: Owned input; this private failed state remains destructible.

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