]> git.proxmox.com Git - rustc.git/blob - src/libstd/sys/unix/ext/mod.rs
Imported Upstream version 1.3.0+dfsg1
[rustc.git] / src / libstd / sys / unix / ext / mod.rs
1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 //! Experimental extensions to `std` for Unix platforms.
12 //!
13 //! For now, this module is limited to extracting file descriptors,
14 //! but its functionality will grow over time.
15 //!
16 //! # Example
17 //!
18 //! ```no_run
19 //! use std::fs::File;
20 //! use std::os::unix::prelude::*;
21 //!
22 //! fn main() {
23 //! let f = File::create("foo.txt").unwrap();
24 //! let fd = f.as_raw_fd();
25 //!
26 //! // use fd with native unix bindings
27 //! }
28 //! ```
29
30 #![stable(feature = "rust1", since = "1.0.0")]
31
32 pub mod io;
33 pub mod ffi;
34 pub mod fs;
35 pub mod process;
36 pub mod raw;
37
38 /// A prelude for conveniently writing platform-specific code.
39 ///
40 /// Includes all extension traits, and some important type definitions.
41 #[stable(feature = "rust1", since = "1.0.0")]
42 pub mod prelude {
43 #[doc(no_inline)]
44 pub use super::io::{RawFd, AsRawFd, FromRawFd};
45 #[doc(no_inline)] #[stable(feature = "rust1", since = "1.0.0")]
46 pub use super::ffi::{OsStrExt, OsStringExt};
47 #[doc(no_inline)]
48 pub use super::fs::{PermissionsExt, OpenOptionsExt, MetadataExt, FileTypeExt};
49 #[doc(no_inline)]
50 pub use super::fs::{DirEntryExt};
51 #[doc(no_inline)] #[stable(feature = "rust1", since = "1.0.0")]
52 pub use super::process::{CommandExt, ExitStatusExt};
53 }