std::rt: Add NotConnected to IoErrorKind
This commit is contained in:
parent
a402fb27fa
commit
8aadcd4851
@ -367,6 +367,7 @@ pub enum IoErrorKind {
|
||||
Closed,
|
||||
ConnectionRefused,
|
||||
ConnectionReset,
|
||||
NotConnected,
|
||||
BrokenPipe,
|
||||
PathAlreadyExists,
|
||||
PathDoesntExist,
|
||||
@ -386,6 +387,7 @@ impl ToStr for IoErrorKind {
|
||||
Closed => ~"Closed",
|
||||
ConnectionRefused => ~"ConnectionRefused",
|
||||
ConnectionReset => ~"ConnectionReset",
|
||||
NotConnected => ~"NotConnected",
|
||||
BrokenPipe => ~"BrokenPipe",
|
||||
PathAlreadyExists => ~"PathAlreadyExists",
|
||||
PathDoesntExist => ~"PathDoesntExist",
|
||||
|
@ -267,6 +267,7 @@ pub fn uv_error_to_io_error(uverr: UvError) -> IoError {
|
||||
EACCES => PermissionDenied,
|
||||
ECONNREFUSED => ConnectionRefused,
|
||||
ECONNRESET => ConnectionReset,
|
||||
ENOTCONN => NotConnected,
|
||||
EPIPE => BrokenPipe,
|
||||
err => {
|
||||
rtdebug!("uverr.code {}", err as int);
|
||||
|
@ -53,6 +53,7 @@ pub mod errors {
|
||||
pub static EACCES: c_int = -4093;
|
||||
pub static ECONNREFUSED: c_int = -4079;
|
||||
pub static ECONNRESET: c_int = -4078;
|
||||
pub static ENOTCONN: c_int = -4054;
|
||||
pub static EPIPE: c_int = -4048;
|
||||
}
|
||||
#[cfg(not(windows))]
|
||||
@ -63,6 +64,7 @@ pub mod errors {
|
||||
pub static EACCES: c_int = -libc::EACCES;
|
||||
pub static ECONNREFUSED: c_int = -libc::ECONNREFUSED;
|
||||
pub static ECONNRESET: c_int = -libc::ECONNRESET;
|
||||
pub static ENOTCONN: c_int = -libc::ENOTCONN;
|
||||
pub static EPIPE: c_int = -libc::EPIPE;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user