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

ChannelBuffer

Establishes unpublished empty state. @param Capacity Positive bound.

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(Capacity: usize)

pub init(Capacity: usize)

Establishes unpublished empty state. Capacity: Positive bound.

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

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

Rejects duplicate FIFO ownership. Source: Existing buffer.

pub init(Source: mut Self&&)

pub init(Source: mut Self&&)

Transfers unpublished FIFO storage and close identity. Source: Buffer left empty.

pub Capacity: usize

pub Capacity: usize

Observes fixed positive logical capacity.

pub IsClosed: bool

pub IsClosed: bool

Observes close state under the queue guard.

TryReserve

pub fn TryReserve() -> Result<void, AllocationError>

Reserves all queue slots before publication; may allocate. Return: Exact allocation failure without queued values.

TryAppend

pub fn TryAppend(mut Value: T) -> Result<void, DequeInsertionError<T>>

Commits one item under a reserved slot and queue guard. Value: Owned item; returned unchanged on allocation failure. Return: Ok or exact owning deque error.

RemoveFront

pub fn RemoveFront() -> T?

Transfers the oldest buffered value under the queue guard. Return: Owned item or none when drained.

Close

pub fn Close() -> bool

Irreversibly closes insertion under the queue guard. Return: True only for the first close.

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