diff options
| author | Georg Brandl <georg@python.org> | 2016-01-07 11:58:08 +0100 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2016-01-07 16:12:38 +0100 |
| commit | cdbf2d6e3643c81211da65255138caf019a80cf7 (patch) | |
| tree | 94885593f476fa623b57e6aca2b47f773a67cdf9 /src/libstd/ffi | |
| parent | 2edb1d9b96bdf78ee06b73d37f1382a30bc67882 (diff) | |
| download | rust-cdbf2d6e3643c81211da65255138caf019a80cf7.tar.gz rust-cdbf2d6e3643c81211da65255138caf019a80cf7.zip | |
Move os_str docs to OsString in order to be visible in HTML (fixes #30743)
Diffstat (limited to 'src/libstd/ffi')
| -rw-r--r-- | src/libstd/ffi/os_str.rs | 40 |
1 files changed, 17 insertions, 23 deletions
diff --git a/src/libstd/ffi/os_str.rs b/src/libstd/ffi/os_str.rs index 90b108e6770..eb5ddecbd05 100644 --- a/src/libstd/ffi/os_str.rs +++ b/src/libstd/ffi/os_str.rs @@ -8,27 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -//! A type that can represent all platform-native strings, but is cheaply -//! interconvertable with Rust strings. -//! -//! The need for this type arises from the fact that: -//! -//! * On Unix systems, strings are often arbitrary sequences of non-zero -//! bytes, in many cases interpreted as UTF-8. -//! -//! * On Windows, strings are often arbitrary sequences of non-zero 16-bit -//! values, interpreted as UTF-16 when it is valid to do so. -//! -//! * In Rust, strings are always valid UTF-8, but may contain zeros. -//! -//! The types in this module bridge this gap by simultaneously representing Rust -//! and platform-native string values, and in particular allowing a Rust string -//! to be converted into an "OS" string with no cost. -//! -//! **Note**: At the moment, these types are extremely bare-bones, usable only -//! for conversion to/from various other string types. Eventually these types -//! will offer a full-fledged string API. - use borrow::{Borrow, Cow, ToOwned}; use ffi::CString; use fmt::{self, Debug}; @@ -42,14 +21,29 @@ use vec::Vec; use sys::os_str::{Buf, Slice}; use sys_common::{AsInner, IntoInner, FromInner}; -/// Owned, mutable OS strings. +/// A type that can represent owned, mutable platform-native strings, but is +/// cheaply interconvertable with Rust strings. +/// +/// The need for this type arises from the fact that: +/// +/// * On Unix systems, strings are often arbitrary sequences of non-zero +/// bytes, in many cases interpreted as UTF-8. +/// +/// * On Windows, strings are often arbitrary sequences of non-zero 16-bit +/// values, interpreted as UTF-16 when it is valid to do so. +/// +/// * In Rust, strings are always valid UTF-8, but may contain zeros. +/// +/// `OsString` and `OsStr` bridge this gap by simultaneously representing Rust +/// and platform-native string values, and in particular allowing a Rust string +/// to be converted into an "OS" string with no cost. #[derive(Clone)] #[stable(feature = "rust1", since = "1.0.0")] pub struct OsString { inner: Buf } -/// Slices into OS strings. +/// Slices into OS strings (see `OsString`). #[stable(feature = "rust1", since = "1.0.0")] pub struct OsStr { inner: Slice |
