diff options
| author | Sachin Cherian <sachinctl@protonmail.com> | 2021-09-17 23:23:21 +0530 |
|---|---|---|
| committer | Sachin Cherian <sachinctl@protonmail.com> | 2021-09-17 23:23:21 +0530 |
| commit | ec34aa61d6947f6bee11f13a8d0a11e61cf65b67 (patch) | |
| tree | 0a138d282edb72c709a4028db839d6cc63f0bf24 /library/std/src/os/windows/mod.rs | |
| parent | c3c0f80d6081092faff801542dd82f0e2420152b (diff) | |
| download | rust-ec34aa61d6947f6bee11f13a8d0a11e61cf65b67.tar.gz rust-ec34aa61d6947f6bee11f13a8d0a11e61cf65b67.zip | |
modify std::os docs to be more consistent
> add intra doc links > add a usage example for the os::windows module
Diffstat (limited to 'library/std/src/os/windows/mod.rs')
| -rw-r--r-- | library/std/src/os/windows/mod.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/library/std/src/os/windows/mod.rs b/library/std/src/os/windows/mod.rs index 969054dd3b3..52eb3b7c067 100644 --- a/library/std/src/os/windows/mod.rs +++ b/library/std/src/os/windows/mod.rs @@ -5,6 +5,22 @@ //! the core `std` library. These extensions allow developers to use //! `std` types and idioms with Windows in a way that the normal //! platform-agnostic idioms would not normally support. +//! +//! # Examples +//! +//! ```no_run +//! use std::fs::File; +//! use std::os::windows::prelude::*; +//! +//! fn main() -> std::io::Result<()> { +//! let f = File::create("foo.txt")?; +//! let handle = f.as_raw_handle(); +//! +//! // use handle with native windows bindings +//! +//! Ok(()) +//! } +//! ``` #![stable(feature = "rust1", since = "1.0.0")] #![doc(cfg(windows))] |
