exposed struct Error {
errno: i32,
}
An I/O error: the errno of the system call that failed, or EIO (5) for a failure the system did not report itself (a write that made no progress). Every fallible function here reports one. It describes itself (message), says what kind of failure it is (kind), and formats as its description and its number, No such file or directory (error 2), so f"cannot read {path}: {e}\n" reports it.
Methods
method of_returnsource
fn of_return(n: isize) -> Error { ... }
The error a negative return of a C function (libc) stands for.
method iosource
fn io() -> Error { ... }
EIO, for a failure the system did not report itself.
method kindsource
fn kind(self) -> ErrorKind { ... }
The kind of failure, from the errno: the C runtime sorts the host's numbers into the kinds.
method messagesource
fn message(self) -> Buffer! { ... }
The C library's description of the errno, as strerror gives it (No such file or directory), read thread-safely (strerror_r).
Instances
instance Format[Error, W]source
forall W where Writer[W].
instance Format[Error, W] { ... }
In std::io.
An error formats as its description and its errno: No such file or directory (error 2).
instance Printable[Error, W]source
forall W where Writer[W].
instance Printable[Error, W] { ... }
In std::io.
An error prints as it formats: No such file or directory (error 2).