]> git.proxmox.com Git - rustc.git/blob - src/libstd/ffi/mod.rs
Imported Upstream version 1.0.0~beta
[rustc.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 #![stable(feature = "rust1", since = "1.0.0")]
14
15 #[stable(feature = "rust1", since = "1.0.0")]
16 pub use self::c_str::{CString, CStr, NulError};
17
18 #[stable(feature = "rust1", since = "1.0.0")]
19 pub use self::os_str::{OsString, OsStr};
20
21 mod c_str;
22 mod os_str;
23
24 // FIXME (#21670): these should be defined in the os_str module
25 /// Freely convertible to an `&OsStr` slice.
26 #[unstable(feature = "std_misc")]
27 pub trait AsOsStr {
28 /// Convert to an `&OsStr` slice.
29 fn as_os_str(&self) -> &OsStr;
30 }