]> git.lizzy.rs Git - rust.git/blob - library/std/src/os/windows/mod.rs
Rollup merge of #104112 - yancyribbens:add-copy-to-repeat-description, r=JohnTitor
[rust.git] / library / std / src / os / windows / mod.rs
1 //! Platform-specific extensions to `std` for Windows.
2 //!
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.
8 //!
9 //! # Examples
10 //!
11 //! ```no_run
12 //! use std::fs::File;
13 //! use std::os::windows::prelude::*;
14 //!
15 //! fn main() -> std::io::Result<()> {
16 //!     let f = File::create("foo.txt")?;
17 //!     let handle = f.as_raw_handle();
18 //!
19 //!     // use handle with native windows bindings
20 //!
21 //!     Ok(())
22 //! }
23 //! ```
24
25 #![stable(feature = "rust1", since = "1.0.0")]
26 #![doc(cfg(windows))]
27
28 pub mod ffi;
29 pub mod fs;
30 pub mod io;
31 pub mod process;
32 pub mod raw;
33 pub mod thread;
34
35 /// A prelude for conveniently writing platform-specific code.
36 ///
37 /// Includes all extension traits, and some important type definitions.
38 #[stable(feature = "rust1", since = "1.0.0")]
39 pub mod prelude {
40     #[doc(no_inline)]
41     #[stable(feature = "rust1", since = "1.0.0")]
42     pub use super::ffi::{OsStrExt, OsStringExt};
43     #[doc(no_inline)]
44     #[stable(feature = "file_offset", since = "1.15.0")]
45     pub use super::fs::FileExt;
46     #[doc(no_inline)]
47     #[stable(feature = "rust1", since = "1.0.0")]
48     pub use super::fs::{MetadataExt, OpenOptionsExt};
49     #[doc(no_inline)]
50     #[stable(feature = "rust1", since = "1.0.0")]
51     pub use super::io::{
52         AsHandle, AsSocket, BorrowedHandle, BorrowedSocket, FromRawHandle, FromRawSocket,
53         HandleOrInvalid, IntoRawHandle, IntoRawSocket, OwnedHandle, OwnedSocket,
54     };
55     #[doc(no_inline)]
56     #[stable(feature = "rust1", since = "1.0.0")]
57     pub use super::io::{AsRawHandle, AsRawSocket, RawHandle, RawSocket};
58 }