]> git.lizzy.rs Git - rust.git/blob - src/libstd/ffi/mod.rs
Auto merge of #22541 - Manishearth:rollup, r=Gankro
[rust.git] / src / libstd / ffi / mod.rs
1 // Copyright 2015 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 //! Utilities related to FFI bindings.
12
13 #![unstable(feature = "std_misc",
14             reason = "module just underwent fairly large reorganization and the dust \
15                       still needs to settle")]
16
17 pub use self::c_str::{CString, CStr, NulError, IntoBytes};
18 #[allow(deprecated)]
19 pub use self::c_str::c_str_to_bytes;
20 #[allow(deprecated)]
21 pub use self::c_str::c_str_to_bytes_with_nul;
22
23 pub use self::os_str::OsString;
24 pub use self::os_str::OsStr;
25
26 mod c_str;
27 mod os_str;
28
29 // FIXME (#21670): these should be defined in the os_str module
30 /// Freely convertible to an `&OsStr` slice.
31 pub trait AsOsStr {
32     /// Convert to an `&OsStr` slice.
33     fn as_os_str(&self) -> &OsStr;
34 }