]> git.proxmox.com Git - rustc.git/blob - src/libstd/sys/redox/ext/mod.rs
New upstream version 1.21.0+dfsg1
[rustc.git] / src / libstd / sys / redox / ext / mod.rs
1 // Copyright 2016 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 //! # Examples
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 #![doc(cfg(target_os = "redox"))]
32
33 pub mod ffi;
34 pub mod fs;
35 pub mod io;
36 pub mod process;
37 pub mod thread;
38
39 /// A prelude for conveniently writing platform-specific code.
40 ///
41 /// Includes all extension traits, and some important type definitions.
42 #[stable(feature = "rust1", since = "1.0.0")]
43 pub mod prelude {
44 #[doc(no_inline)] #[stable(feature = "rust1", since = "1.0.0")]
45 pub use super::io::{RawFd, AsRawFd, FromRawFd, IntoRawFd};
46 #[doc(no_inline)] #[stable(feature = "rust1", since = "1.0.0")]
47 pub use super::ffi::{OsStrExt, OsStringExt};
48 #[doc(no_inline)] #[stable(feature = "rust1", since = "1.0.0")]
49 pub use super::fs::{FileTypeExt, PermissionsExt, OpenOptionsExt, MetadataExt};
50 #[doc(no_inline)] #[stable(feature = "rust1", since = "1.0.0")]
51 pub use super::thread::JoinHandleExt;
52 #[doc(no_inline)] #[stable(feature = "rust1", since = "1.0.0")]
53 pub use super::process::{CommandExt, ExitStatusExt};
54 }