Under heavy development. This site describes the intended 1.0 language. Current features and performance vary. Development status
Sn50SnThe SnAPI programming language
Development · Evolving reference

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. This reference includes the intended 1.0 design; features may be incomplete in the current compiler. 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