winapi_util/
lib.rs

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