Struct std::io::ErrorUnstable
[-] [+]
[src]
pub struct Error { // some fields omitted }
The error type for I/O operations of the Read
, Write
, Seek
, and
associated traits.
Errors mostly originate from the underlying OS, but custom instances of
Error
can be created with crafted error messages and a particular value of
ErrorKind
.
Methods
impl Error
fn new(kind: ErrorKind, description: &'static str, detail: Option<String>) -> Error
Creates a new custom error from a specified kind/description/detail.
fn last_os_error() -> Error
Returns an error representing the last OS error which occurred.
This function reads the value of errno
for the target platform (e.g.
GetLastError
on Windows) and will return a corresponding instance of
Error
for the error code.
fn from_os_error(code: i32) -> Error
Creates a new instance of an Error
from a particular OS error code.
fn kind(&self) -> ErrorKind
Return the corresponding ErrorKind
for this error.
fn description(&self) -> &str
Returns a short description for this error message
fn detail(&self) -> Option<String>
Returns a detailed error message for this error (if one is available)