1 //! Platform-specific extensions to `std` for Windows.
3 //! Provides access to platform-level information for Windows, and exposes
4 //! Windows-specific idioms that would otherwise be inappropriate as part
5 //! the core `std` library. These extensions allow developers to use
6 //! `std` types and idioms with Windows in a way that the normal
7 //! platform-agnostic idioms would not normally support.
12 //! use std::fs::File;
13 //! use std::os::windows::prelude::*;
15 //! fn main() -> std::io::Result<()> {
16 //! let f = File::create("foo.txt")?;
17 //! let handle = f.as_raw_handle();
19 //! // use handle with native windows bindings
25 #![stable(feature = "rust1", since = "1.0.0")]
35 /// A prelude for conveniently writing platform-specific code.
37 /// Includes all extension traits, and some important type definitions.
38 #[stable(feature = "rust1", since = "1.0.0")]
41 #[stable(feature = "rust1", since = "1.0.0")]
42 pub use super::ffi::{OsStrExt, OsStringExt};
44 #[stable(feature = "file_offset", since = "1.15.0")]
45 pub use super::fs::FileExt;
47 #[stable(feature = "rust1", since = "1.0.0")]
48 pub use super::fs::{MetadataExt, OpenOptionsExt};
50 #[stable(feature = "rust1", since = "1.0.0")]
52 AsHandle, AsSocket, BorrowedHandle, BorrowedSocket, FromRawHandle, FromRawSocket,
53 HandleOrInvalid, IntoRawHandle, IntoRawSocket, OwnedHandle, OwnedSocket,
56 #[stable(feature = "rust1", since = "1.0.0")]
57 pub use super::io::{AsRawHandle, AsRawSocket, RawHandle, RawSocket};