about summary refs log tree commit diff
path: root/library/std/src/os/windows/mod.rs
diff options
context:
space:
mode:
authorSachin Cherian <sachinctl@protonmail.com>2021-09-17 23:23:21 +0530
committerSachin Cherian <sachinctl@protonmail.com>2021-09-17 23:23:21 +0530
commitec34aa61d6947f6bee11f13a8d0a11e61cf65b67 (patch)
tree0a138d282edb72c709a4028db839d6cc63f0bf24 /library/std/src/os/windows/mod.rs
parentc3c0f80d6081092faff801542dd82f0e2420152b (diff)
downloadrust-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.rs16
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))]