use net;
use sys_common::{self, AsInner, FromInner, IntoInner};
use sys;
+use io;
use sys::c;
/// Raw HANDLEs.
}
}
+#[stable(feature = "asraw_stdio", since = "1.21.0")]
+impl AsRawHandle for io::Stdin {
+ fn as_raw_handle(&self) -> RawHandle {
+ unsafe { c::GetStdHandle(c::STD_INPUT_HANDLE) } as RawHandle
+ }
+}
+
+#[stable(feature = "asraw_stdio", since = "1.21.0")]
+impl AsRawHandle for io::Stdout {
+ fn as_raw_handle(&self) -> RawHandle {
+ unsafe { c::GetStdHandle(c::STD_OUTPUT_HANDLE) } as RawHandle
+ }
+}
+
+#[stable(feature = "asraw_stdio", since = "1.21.0")]
+impl AsRawHandle for io::Stderr {
+ fn as_raw_handle(&self) -> RawHandle {
+ unsafe { c::GetStdHandle(c::STD_ERROR_HANDLE) } as RawHandle
+ }
+}
+
#[stable(feature = "from_raw_os", since = "1.1.0")]
impl FromRawHandle for fs::File {
unsafe fn from_raw_handle(handle: RawHandle) -> fs::File {