Skip to content

Io

Module: std.io
Source: std/io.zn

Stdin

Standard input handle


Fields:

// No Fields

Methods:

pub fn read_line(buf: *String) bool;
pub fn read_to_string(buf: *String) bool;
pub fn read_exact(buf: *String, n: usize) bool;

Stdout

Standard output handle


Fields:

// No Fields

Methods:

pub fn write(value: []const char) void;
pub fn write_string(value: *String) void;
pub fn flush() void;

Stderr

Standard error handle


Fields:

// No Fields

Methods:

pub fn write(value: []const char) void;
pub fn flush() void;

IoError

IO error with a kind and a human readable message


Fields:

_kind: IoErrorKind,
_message: String,

Constructors:

pub fn new(kind: IoErrorKind, message: []const char) Self;
pub fn from_errno(code: c_int) Self;
pub fn last_os_error() Self;
pub fn win_error(code: WinDWORD) IoError;

Getters:

pub fn kind(*const self) IoErrorKind;
pub fn message(self) String;

IoErrorKind

IO error kind


NotFound,
PermissionDenied,
AlreadyExists,
InvalidInput,
InvalidData,
UnexpectedEof,
WriteZero,
Interrupted,
WouldBlock,
TimedOut,
BrokenPipe,
ConnectionRefused,
ConnectionReset,
ConnectionAborted,
NotConnected,
AddrInUse,
AddrNotAvailable,
IsADirectory,
NotADirectory,
Unsupported,
OutOfMemory,
Uncategorized,