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

IoError

Classifies portable output and byte-stream failures.

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.

IoError

pub enum IoError

Classifies portable output and byte-stream failures.

OutputFailed preserves the original output identity. Failure carries a portable reason and already transferred byte prefix, never host errno. Counts are relative to the current operation, not cumulative stream position.

Example

module example.io_error;
from std.io import IoError, TryPrint;
fn Main() -> i32 {
    let ResultValue = TryPrint("ready");
    switch ResultValue {
        case .Ok => return 0;
        case .Err { Error = _ } => return 1;
    }
}

IoError.OutputFailed

OutputFailed;

Reports that canonical output could not accept the complete byte view.

IoError.Failure

Failure;

Preserves a portable reason and operation-relative transferred prefix.

IoError.Failure.Reason

Reason: IoFailure;

IoError.Failure.Transferred

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