0.2.0 Preview 1 · Frozen documentation
IoError
Classifies portable output and byte-stream failures.
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.
IoError
pub enum IoErrorClassifies 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 ↗