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

StreamReadError

Owns proven consumed bytes when whole-stream collection fails. Bytes includes valid partial provider progress before failure. Reason's count equals Bytes.Length; bytes are not silently refunded to the source. Source remains caller-owned. This record adds no synchronization or decoding.

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

import std.io;

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

StreamReadError

pub final class StreamReadError

Owns proven consumed bytes when whole-stream collection fails. Bytes includes valid partial provider progress before failure. Reason's count equals Bytes.Length; bytes are not silently refunded to the source. Source remains caller-owned. This record adds no synchronization or decoding.

StreamReadError.Reason

pub Reason: IoError;

Portable failure whose count equals the retained byte prefix.

StreamReadError.Bytes

pub Bytes: Vector<byte>;

Sole owner of the consumed prefix, available for inspection/recovery.

StreamReadError.CleanupError

pub CleanupError: IoError?;

Secondary close failure after a primary read failure, otherwise none.

StreamReadError.init

pub init(Reason: IoError, mut Bytes: Vector<byte>, CleanupError: IoError?)

Transfers proven prefix ownership without copying or allocation. Reason: Failure rebased to Bytes.Length. Bytes: Owned prefix. CleanupError: Optional secondary cleanup failure; owns its reason.

StreamReadError.init

pub init(Reason: IoError, mut Bytes: Vector<byte>)

Supplies the omitted arguments to init. Note: Defaults: CleanupError = none. Reason: Same input, ownership and lifetime contract as the full operation. Bytes: Same input, ownership and lifetime contract as the full operation.

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