1 /*!
2 This crate provides a smattering of safe routines for parts of winapi. The
3 primary purpose of this crate is to serve as a dumping ground for various
4 utility functions that make interactions with winapi safe. This permits the
5 centralization of `unsafe` when dealing with Windows APIs, and thus makes it
6 easier to audit.
7 
8 A key abstraction in this crate is the combination of the
9 [`Handle`](struct.Handle.html)
10 and
11 [`HandleRef`](struct.HandleRef.html)
12 types. Both represent a valid Windows handle to an I/O-like object, where
13 `Handle` is owned (the resource is closed when the handle is dropped) and
14 `HandleRef` is borrowed (the resource is not closed when the handle is
15 dropped). Many of the routines in this crate work on handles and accept
16 anything that can be safely converted into a `HandleRef`. This includes
17 standard library types such as `File`, `Stdin`, `Stdout` and `Stderr`.
18 
19 Note that this crate is completely empty on non-Windows platforms.
20 */
21 
22 #[cfg(windows)]
23 pub use win::*;
24 
25 /// Safe routines for dealing with the Windows console.
26 #[cfg(windows)]
27 pub mod console;
28 /// Safe routines for dealing with files and handles on Windows.
29 #[cfg(windows)]
30 pub mod file;
31 #[cfg(windows)]
32 mod win;
33