295 lines
No EOL
32 KiB
HTML
295 lines
No EOL
32 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<meta name="generator" content="rustdoc">
|
||
<meta name="description" content="API documentation for the Rust `CString` struct in crate `bitflags`.">
|
||
<meta name="keywords" content="rust, rustlang, rust-lang, CString">
|
||
|
||
<title>bitflags::__core::ffi::CString - Rust</title>
|
||
|
||
<link rel="stylesheet" type="text/css" href="../../../rustdoc.css">
|
||
<link rel="stylesheet" type="text/css" href="../../../main.css">
|
||
|
||
|
||
|
||
|
||
</head>
|
||
<body class="rustdoc">
|
||
<!--[if lte IE 8]>
|
||
<div class="warning">
|
||
This old browser is unsupported and will most likely display funky
|
||
things.
|
||
</div>
|
||
<![endif]-->
|
||
|
||
|
||
|
||
<nav class="sidebar">
|
||
|
||
<p class='location'><a href='../../index.html'>bitflags</a>::<wbr><a href='../index.html'>__core</a>::<wbr><a href='index.html'>ffi</a></p><script>window.sidebarCurrent = {name: 'CString', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script>
|
||
</nav>
|
||
|
||
<nav class="sub">
|
||
<form class="search-form js-only">
|
||
<div class="search-container">
|
||
<input class="search-input" name="search"
|
||
autocomplete="off"
|
||
placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
|
||
type="search">
|
||
</div>
|
||
</form>
|
||
</nav>
|
||
|
||
<section id='main' class="content struct">
|
||
<h1 class='fqn'><span class='in-band'>Struct <a href='../../index.html'>bitflags</a>::<wbr><a href='../index.html'>__core</a>::<wbr><a href='index.html'>ffi</a>::<wbr><a class='struct' href=''>CString</a></span><span class='out-of-band'><span id='render-detail'>
|
||
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
|
||
[<span class='inner'>−</span>]
|
||
</a>
|
||
</span><a id='src-2991' class='srclink' href='https://doc.rust-lang.org/nightly/std/ffi/c_str/struct.CString.html?gotosrc=2991' title='goto source code'>[src]</a></span></h1>
|
||
<pre class='rust struct'>pub struct CString {
|
||
// some fields omitted
|
||
}</pre><span class="since">1.0.0</span><div class='docblock'><p>A type representing an owned C-compatible string</p>
|
||
|
||
<p>This type serves the primary purpose of being able to safely generate a
|
||
C-compatible string from a Rust byte slice or vector. An instance of this
|
||
type is a static guarantee that the underlying bytes contain no interior 0
|
||
bytes and the final byte is 0.</p>
|
||
|
||
<p>A <code>CString</code> is created from either a byte slice or a byte vector. After
|
||
being created, a <code>CString</code> predominately inherits all of its methods from
|
||
the <code>Deref</code> implementation to <code>[c_char]</code>. Note that the underlying array
|
||
is represented as an array of <code>c_char</code> as opposed to <code>u8</code>. A <code>u8</code> slice
|
||
can be obtained with the <code>as_bytes</code> method. Slices produced from a <code>CString</code>
|
||
do <em>not</em> contain the trailing nul terminator unless otherwise specified.</p>
|
||
|
||
<h1 id='examples' class='section-header'><a href='#examples'>Examples</a></h1>
|
||
<pre class='rust rust-example-rendered'>
|
||
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>ffi</span>::<span class='ident'>CString</span>;
|
||
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>os</span>::<span class='ident'>raw</span>::<span class='ident'>c_char</span>;
|
||
|
||
<span class='kw'>extern</span> {
|
||
<span class='kw'>fn</span> <span class='ident'>my_printer</span>(<span class='ident'>s</span>: <span class='op'>*</span><span class='kw'>const</span> <span class='ident'>c_char</span>);
|
||
}
|
||
|
||
<span class='kw'>let</span> <span class='ident'>c_to_print</span> <span class='op'>=</span> <span class='ident'>CString</span>::<span class='ident'>new</span>(<span class='string'>"Hello, world!"</span>).<span class='ident'>unwrap</span>();
|
||
<span class='kw'>unsafe</span> {
|
||
<span class='ident'>my_printer</span>(<span class='ident'>c_to_print</span>.<span class='ident'>as_ptr</span>());
|
||
}</pre>
|
||
|
||
<h1 id='safety' class='section-header'><a href='#safety'>Safety</a></h1>
|
||
<p><code>CString</code> is intended for working with traditional C-style strings
|
||
(a sequence of non-null bytes terminated by a single null byte); the
|
||
primary use case for these kinds of strings is interoperating with C-like
|
||
code. Often you will need to transfer ownership to/from that external
|
||
code. It is strongly recommended that you thoroughly read through the
|
||
documentation of <code>CString</code> before use, as improper ownership management
|
||
of <code>CString</code> instances can lead to invalid memory accesses, memory leaks,
|
||
and other memory errors.</p>
|
||
</div><h2 id='methods'>Methods</h2><h3 class='impl'><code>impl <a class='struct' href='../../../bitflags/__core/ffi/struct.CString.html' title='bitflags::__core::ffi::CString'>CString</a></code></h3><div class='impl-items'><h4 id='method.new' class='method'><code>fn <a href='#method.new' class='fnname'>new</a><T>(t: T) -> <a class='enum' href='../../../bitflags/__core/result/enum.Result.html' title='bitflags::__core::result::Result'>Result</a><<a class='struct' href='../../../bitflags/__core/ffi/struct.CString.html' title='bitflags::__core::ffi::CString'>CString</a>, <a class='struct' href='../../../bitflags/__core/ffi/struct.NulError.html' title='bitflags::__core::ffi::NulError'>NulError</a>> <span class='where'>where T: <a class='trait' href='../../../bitflags/__core/convert/trait.Into.html' title='bitflags::__core::convert::Into'>Into</a><<a class='struct' href='../../../bitflags/__core/vec/struct.Vec.html' title='bitflags::__core::vec::Vec'>Vec</a><<a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.u8.html'>u8</a>>></span></code></h4>
|
||
<div class='docblock'><p>Creates a new C-compatible string from a container of bytes.</p>
|
||
|
||
<p>This method will consume the provided data and use the underlying bytes
|
||
to construct a new string, ensuring that there is a trailing 0 byte.</p>
|
||
|
||
<h1 id='examples-1' class='section-header'><a href='#examples-1'>Examples</a></h1>
|
||
<pre class='rust rust-example-rendered'>
|
||
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>ffi</span>::<span class='ident'>CString</span>;
|
||
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>os</span>::<span class='ident'>raw</span>::<span class='ident'>c_char</span>;
|
||
|
||
<span class='kw'>extern</span> { <span class='kw'>fn</span> <span class='ident'>puts</span>(<span class='ident'>s</span>: <span class='op'>*</span><span class='kw'>const</span> <span class='ident'>c_char</span>); }
|
||
|
||
<span class='kw'>fn</span> <span class='ident'>main</span>() {
|
||
<span class='kw'>let</span> <span class='ident'>to_print</span> <span class='op'>=</span> <span class='ident'>CString</span>::<span class='ident'>new</span>(<span class='string'>"Hello!"</span>).<span class='ident'>unwrap</span>();
|
||
<span class='kw'>unsafe</span> {
|
||
<span class='ident'>puts</span>(<span class='ident'>to_print</span>.<span class='ident'>as_ptr</span>());
|
||
}
|
||
}</pre>
|
||
|
||
<h1 id='errors' class='section-header'><a href='#errors'>Errors</a></h1>
|
||
<p>This function will return an error if the bytes yielded contain an
|
||
internal 0 byte. The error returned will contain the bytes as well as
|
||
the position of the nul byte.</p>
|
||
</div><h4 id='method.from_vec_unchecked' class='method'><code>unsafe fn <a href='#method.from_vec_unchecked' class='fnname'>from_vec_unchecked</a>(v: <a class='struct' href='../../../bitflags/__core/vec/struct.Vec.html' title='bitflags::__core::vec::Vec'>Vec</a><<a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.u8.html'>u8</a>>) -> <a class='struct' href='../../../bitflags/__core/ffi/struct.CString.html' title='bitflags::__core::ffi::CString'>CString</a></code></h4>
|
||
<div class='docblock'><p>Creates a C-compatible string from a byte vector without checking for
|
||
interior 0 bytes.</p>
|
||
|
||
<p>This method is equivalent to <code>new</code> except that no runtime assertion
|
||
is made that <code>v</code> contains no 0 bytes, and it requires an actual
|
||
byte vector, not anything that can be converted to one with Into.</p>
|
||
</div><h4 id='method.from_raw' class='method'><code>unsafe fn <a href='#method.from_raw' class='fnname'>from_raw</a>(ptr: <a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.pointer.html'>*mut </a><a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.i8.html'>i8</a>) -> <a class='struct' href='../../../bitflags/__core/ffi/struct.CString.html' title='bitflags::__core::ffi::CString'>CString</a></code><span class="since">1.4.0</span></h4>
|
||
<div class='docblock'><p>Retakes ownership of a <code>CString</code> that was transferred to C.</p>
|
||
|
||
<p>This should only ever be called with a pointer that was earlier
|
||
obtained by calling <code>into_raw</code> on a <code>CString</code>. Additionally, the length
|
||
of the string will be recalculated from the pointer.</p>
|
||
</div><h4 id='method.into_raw' class='method'><code>fn <a href='#method.into_raw' class='fnname'>into_raw</a>(self) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.pointer.html'>*mut </a><a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.i8.html'>i8</a></code><span class="since">1.4.0</span></h4>
|
||
<div class='docblock'><p>Transfers ownership of the string to a C caller.</p>
|
||
|
||
<p>The pointer must be returned to Rust and reconstituted using
|
||
<code>from_raw</code> to be properly deallocated. Specifically, one
|
||
should <em>not</em> use the standard C <code>free</code> function to deallocate
|
||
this string.</p>
|
||
|
||
<p>Failure to call <code>from_raw</code> will lead to a memory leak.</p>
|
||
</div><h4 id='method.into_string' class='method'><code>fn <a href='#method.into_string' class='fnname'>into_string</a>(self) -> <a class='enum' href='../../../bitflags/__core/result/enum.Result.html' title='bitflags::__core::result::Result'>Result</a><<a class='struct' href='../../../bitflags/__core/string/struct.String.html' title='bitflags::__core::string::String'>String</a>, <a class='struct' href='../../../bitflags/__core/ffi/struct.IntoStringError.html' title='bitflags::__core::ffi::IntoStringError'>IntoStringError</a>></code><span class="since">1.7.0</span></h4>
|
||
<div class='docblock'><p>Converts the <code>CString</code> into a <code>String</code> if it contains valid Unicode data.</p>
|
||
|
||
<p>On failure, ownership of the original <code>CString</code> is returned.</p>
|
||
</div><h4 id='method.into_bytes' class='method'><code>fn <a href='#method.into_bytes' class='fnname'>into_bytes</a>(self) -> <a class='struct' href='../../../bitflags/__core/vec/struct.Vec.html' title='bitflags::__core::vec::Vec'>Vec</a><<a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.u8.html'>u8</a>></code><span class="since">1.7.0</span></h4>
|
||
<div class='docblock'><p>Returns the underlying byte buffer.</p>
|
||
|
||
<p>The returned buffer does <strong>not</strong> contain the trailing nul separator and
|
||
it is guaranteed to not have any interior nul bytes.</p>
|
||
</div><h4 id='method.into_bytes_with_nul' class='method'><code>fn <a href='#method.into_bytes_with_nul' class='fnname'>into_bytes_with_nul</a>(self) -> <a class='struct' href='../../../bitflags/__core/vec/struct.Vec.html' title='bitflags::__core::vec::Vec'>Vec</a><<a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.u8.html'>u8</a>></code><span class="since">1.7.0</span></h4>
|
||
<div class='docblock'><p>Equivalent to the <code>into_bytes</code> function except that the returned vector
|
||
includes the trailing nul byte.</p>
|
||
</div><h4 id='method.as_bytes' class='method'><code>fn <a href='#method.as_bytes' class='fnname'>as_bytes</a>(&self) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.slice.html'>&[</a><a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.u8.html'>u8</a><a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.slice.html'>]</a></code></h4>
|
||
<div class='docblock'><p>Returns the contents of this <code>CString</code> as a slice of bytes.</p>
|
||
|
||
<p>The returned slice does <strong>not</strong> contain the trailing nul separator and
|
||
it is guaranteed to not have any interior nul bytes.</p>
|
||
</div><h4 id='method.as_bytes_with_nul' class='method'><code>fn <a href='#method.as_bytes_with_nul' class='fnname'>as_bytes_with_nul</a>(&self) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.slice.html'>&[</a><a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.u8.html'>u8</a><a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.slice.html'>]</a></code></h4>
|
||
<div class='docblock'><p>Equivalent to the <code>as_bytes</code> function except that the returned slice
|
||
includes the trailing nul byte.</p>
|
||
</div></div><h2 id='deref-methods'>Methods from <a class='trait' href='../../../bitflags/__core/ops/trait.Deref.html' title='bitflags::__core::ops::Deref'>Deref</a><Target=<a class='struct' href='../../../bitflags/__core/ffi/struct.CStr.html' title='bitflags::__core::ffi::CStr'>CStr</a>></h2><div class='impl-items'><h4 id='method.as_ptr' class='method'><code>fn <a href='#method.as_ptr' class='fnname'>as_ptr</a>(&self) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.pointer.html'>*const </a><a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.i8.html'>i8</a></code></h4>
|
||
<div class='docblock'><p>Returns the inner pointer to this C string.</p>
|
||
|
||
<p>The returned pointer will be valid for as long as <code>self</code> is and points
|
||
to a contiguous region of memory terminated with a 0 byte to represent
|
||
the end of the string.</p>
|
||
</div><h4 id='method.to_bytes' class='method'><code>fn <a href='#method.to_bytes' class='fnname'>to_bytes</a>(&self) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.slice.html'>&[</a><a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.u8.html'>u8</a><a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.slice.html'>]</a></code></h4>
|
||
<div class='docblock'><p>Converts this C string to a byte slice.</p>
|
||
|
||
<p>This function will calculate the length of this string (which normally
|
||
requires a linear amount of work to be done) and then return the
|
||
resulting slice of <code>u8</code> elements.</p>
|
||
|
||
<p>The returned slice will <strong>not</strong> contain the trailing nul that this C
|
||
string has.</p>
|
||
|
||
<blockquote>
|
||
<p><strong>Note</strong>: This method is currently implemented as a 0-cost cast, but
|
||
it is planned to alter its definition in the future to perform the
|
||
length calculation whenever this method is called.</p>
|
||
</blockquote>
|
||
</div><h4 id='method.to_bytes_with_nul' class='method'><code>fn <a href='#method.to_bytes_with_nul' class='fnname'>to_bytes_with_nul</a>(&self) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.slice.html'>&[</a><a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.u8.html'>u8</a><a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.slice.html'>]</a></code></h4>
|
||
<div class='docblock'><p>Converts this C string to a byte slice containing the trailing 0 byte.</p>
|
||
|
||
<p>This function is the equivalent of <code>to_bytes</code> except that it will retain
|
||
the trailing nul instead of chopping it off.</p>
|
||
|
||
<blockquote>
|
||
<p><strong>Note</strong>: This method is currently implemented as a 0-cost cast, but
|
||
it is planned to alter its definition in the future to perform the
|
||
length calculation whenever this method is called.</p>
|
||
</blockquote>
|
||
</div><h4 id='method.to_str' class='method'><code>fn <a href='#method.to_str' class='fnname'>to_str</a>(&self) -> <a class='enum' href='../../../bitflags/__core/result/enum.Result.html' title='bitflags::__core::result::Result'>Result</a><&<a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.str.html'>str</a>, <a class='struct' href='../../../bitflags/__core/str/struct.Utf8Error.html' title='bitflags::__core::str::Utf8Error'>Utf8Error</a>></code><span class="since">1.4.0</span></h4>
|
||
<div class='docblock'><p>Yields a <code>&str</code> slice if the <code>CStr</code> contains valid UTF-8.</p>
|
||
|
||
<p>This function will calculate the length of this string and check for
|
||
UTF-8 validity, and then return the <code>&str</code> if it's valid.</p>
|
||
|
||
<blockquote>
|
||
<p><strong>Note</strong>: This method is currently implemented to check for validity
|
||
after a 0-cost cast, but it is planned to alter its definition in the
|
||
future to perform the length calculation in addition to the UTF-8
|
||
check whenever this method is called.</p>
|
||
</blockquote>
|
||
</div><h4 id='method.to_string_lossy' class='method'><code>fn <a href='#method.to_string_lossy' class='fnname'>to_string_lossy</a>(&self) -> <a class='enum' href='../../../bitflags/__core/borrow/enum.Cow.html' title='bitflags::__core::borrow::Cow'>Cow</a><<a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.str.html'>str</a>></code><span class="since">1.4.0</span></h4>
|
||
<div class='docblock'><p>Converts a <code>CStr</code> into a <code>Cow<str></code>.</p>
|
||
|
||
<p>This function will calculate the length of this string (which normally
|
||
requires a linear amount of work to be done) and then return the
|
||
resulting slice as a <code>Cow<str></code>, replacing any invalid UTF-8 sequences
|
||
with <code>U+FFFD REPLACEMENT CHARACTER</code>.</p>
|
||
|
||
<blockquote>
|
||
<p><strong>Note</strong>: This method is currently implemented to check for validity
|
||
after a 0-cost cast, but it is planned to alter its definition in the
|
||
future to perform the length calculation in addition to the UTF-8
|
||
check whenever this method is called.</p>
|
||
</blockquote>
|
||
</div></div><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><code>impl <a class='trait' href='../../../bitflags/__core/ops/trait.Deref.html' title='bitflags::__core::ops::Deref'>Deref</a> for <a class='struct' href='../../../bitflags/__core/ffi/struct.CString.html' title='bitflags::__core::ffi::CString'>CString</a></code></h3><div class='impl-items'><h4 id='associatedtype.Target' class='type'><code>type <a href='../../../bitflags/__core/ops/trait.Deref.html#associatedtype.Target' class='type'>Target</a> = <a class='struct' href='../../../bitflags/__core/ffi/struct.CStr.html' title='bitflags::__core::ffi::CStr'>CStr</a></code></h4>
|
||
<h4 id='method.deref' class='method'><code>fn <a href='../../../bitflags/__core/ops/trait.Deref.html#tymethod.deref' class='fnname'>deref</a>(&self) -> &<a class='struct' href='../../../bitflags/__core/ffi/struct.CStr.html' title='bitflags::__core::ffi::CStr'>CStr</a></code></h4>
|
||
</div><h3 class='impl'><code>impl <a class='trait' href='../../../bitflags/__core/fmt/trait.Debug.html' title='bitflags::__core::fmt::Debug'>Debug</a> for <a class='struct' href='../../../bitflags/__core/ffi/struct.CString.html' title='bitflags::__core::ffi::CString'>CString</a></code></h3><div class='impl-items'><h4 id='method.fmt' class='method'><code>fn <a href='../../../bitflags/__core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class='struct' href='../../../bitflags/__core/fmt/struct.Formatter.html' title='bitflags::__core::fmt::Formatter'>Formatter</a>) -> <a class='enum' href='../../../bitflags/__core/result/enum.Result.html' title='bitflags::__core::result::Result'>Result</a><<a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.tuple.html'>()</a>, <a class='struct' href='../../../bitflags/__core/fmt/struct.Error.html' title='bitflags::__core::fmt::Error'>Error</a>></code></h4>
|
||
</div><h3 class='impl'><code>impl <a class='trait' href='../../../bitflags/__core/borrow/trait.Borrow.html' title='bitflags::__core::borrow::Borrow'>Borrow</a><<a class='struct' href='../../../bitflags/__core/ffi/struct.CStr.html' title='bitflags::__core::ffi::CStr'>CStr</a>> for <a class='struct' href='../../../bitflags/__core/ffi/struct.CString.html' title='bitflags::__core::ffi::CString'>CString</a></code><span class="since">1.3.0</span></h3><div class='impl-items'><h4 id='method.borrow' class='method'><code>fn <a href='../../../bitflags/__core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> &<a class='struct' href='../../../bitflags/__core/ffi/struct.CStr.html' title='bitflags::__core::ffi::CStr'>CStr</a></code></h4>
|
||
</div><h3 class='impl'><code>impl<'a> <a class='trait' href='../../../bitflags/__core/convert/trait.From.html' title='bitflags::__core::convert::From'>From</a><&'a <a class='struct' href='../../../bitflags/__core/ffi/struct.CStr.html' title='bitflags::__core::ffi::CStr'>CStr</a>> for <a class='struct' href='../../../bitflags/__core/ffi/struct.CString.html' title='bitflags::__core::ffi::CString'>CString</a></code><span class="since">1.7.0</span></h3><div class='impl-items'><h4 id='method.from' class='method'><code>fn <a href='../../../bitflags/__core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(s: &'a <a class='struct' href='../../../bitflags/__core/ffi/struct.CStr.html' title='bitflags::__core::ffi::CStr'>CStr</a>) -> <a class='struct' href='../../../bitflags/__core/ffi/struct.CString.html' title='bitflags::__core::ffi::CString'>CString</a></code></h4>
|
||
</div><h3 class='impl'><code>impl <a class='trait' href='../../../bitflags/__core/ops/trait.Index.html' title='bitflags::__core::ops::Index'>Index</a><<a class='struct' href='../../../bitflags/__core/ops/struct.RangeFull.html' title='bitflags::__core::ops::RangeFull'>RangeFull</a>> for <a class='struct' href='../../../bitflags/__core/ffi/struct.CString.html' title='bitflags::__core::ffi::CString'>CString</a></code><span class="since">1.7.0</span></h3><div class='impl-items'><h4 id='associatedtype.Output' class='type'><code>type <a href='../../../bitflags/__core/ops/trait.Index.html#associatedtype.Output' class='type'>Output</a> = <a class='struct' href='../../../bitflags/__core/ffi/struct.CStr.html' title='bitflags::__core::ffi::CStr'>CStr</a></code></h4>
|
||
<h4 id='method.index' class='method'><code>fn <a href='../../../bitflags/__core/ops/trait.Index.html#tymethod.index' class='fnname'>index</a>(&self, _index: <a class='struct' href='../../../bitflags/__core/ops/struct.RangeFull.html' title='bitflags::__core::ops::RangeFull'>RangeFull</a>) -> &<a class='struct' href='../../../bitflags/__core/ffi/struct.CStr.html' title='bitflags::__core::ffi::CStr'>CStr</a></code></h4>
|
||
</div><h3 class='impl'><code>impl <a class='trait' href='../../../bitflags/__core/convert/trait.AsRef.html' title='bitflags::__core::convert::AsRef'>AsRef</a><<a class='struct' href='../../../bitflags/__core/ffi/struct.CStr.html' title='bitflags::__core::ffi::CStr'>CStr</a>> for <a class='struct' href='../../../bitflags/__core/ffi/struct.CString.html' title='bitflags::__core::ffi::CString'>CString</a></code><span class="since">1.7.0</span></h3><div class='impl-items'><h4 id='method.as_ref' class='method'><code>fn <a href='../../../bitflags/__core/convert/trait.AsRef.html#tymethod.as_ref' class='fnname'>as_ref</a>(&self) -> &<a class='struct' href='../../../bitflags/__core/ffi/struct.CStr.html' title='bitflags::__core::ffi::CStr'>CStr</a></code></h4>
|
||
</div><h3 id='derived_implementations'>Derived Implementations </h3><h3 class='impl'><code>impl <a class='trait' href='../../../bitflags/__core/clone/trait.Clone.html' title='bitflags::__core::clone::Clone'>Clone</a> for <a class='struct' href='../../../bitflags/__core/ffi/struct.CString.html' title='bitflags::__core::ffi::CString'>CString</a></code></h3><div class='impl-items'><h4 id='method.clone' class='method'><code>fn <a href='../../../bitflags/__core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class='struct' href='../../../bitflags/__core/ffi/struct.CString.html' title='bitflags::__core::ffi::CString'>CString</a></code></h4>
|
||
<h4 id='method.clone_from' class='method'><code>fn <a href='../../../bitflags/__core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: &Self)</code></h4>
|
||
</div><h3 class='impl'><code>impl <a class='trait' href='../../../bitflags/__core/hash/trait.Hash.html' title='bitflags::__core::hash::Hash'>Hash</a> for <a class='struct' href='../../../bitflags/__core/ffi/struct.CString.html' title='bitflags::__core::ffi::CString'>CString</a></code></h3><div class='impl-items'><h4 id='method.hash' class='method'><code>fn <a href='../../../bitflags/__core/hash/trait.Hash.html#tymethod.hash' class='fnname'>hash</a><__H>(&self, __arg_0: &mut __H) <span class='where'>where __H: <a class='trait' href='../../../bitflags/__core/hash/trait.Hasher.html' title='bitflags::__core::hash::Hasher'>Hasher</a></span></code></h4>
|
||
<h4 id='method.hash_slice' class='method'><code>fn <a href='../../../bitflags/__core/hash/trait.Hash.html#method.hash_slice' class='fnname'>hash_slice</a><H>(data: <a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.slice.html'>&[Self]</a>, state: &mut H) <span class='where'>where H: <a class='trait' href='../../../bitflags/__core/hash/trait.Hasher.html' title='bitflags::__core::hash::Hasher'>Hasher</a></span></code><span class="since">1.3.0</span></h4>
|
||
</div><h3 class='impl'><code>impl <a class='trait' href='../../../bitflags/__core/cmp/trait.Ord.html' title='bitflags::__core::cmp::Ord'>Ord</a> for <a class='struct' href='../../../bitflags/__core/ffi/struct.CString.html' title='bitflags::__core::ffi::CString'>CString</a></code></h3><div class='impl-items'><h4 id='method.cmp' class='method'><code>fn <a href='../../../bitflags/__core/cmp/trait.Ord.html#tymethod.cmp' class='fnname'>cmp</a>(&self, __arg_0: &<a class='struct' href='../../../bitflags/__core/ffi/struct.CString.html' title='bitflags::__core::ffi::CString'>CString</a>) -> <a class='enum' href='../../../bitflags/__core/cmp/enum.Ordering.html' title='bitflags::__core::cmp::Ordering'>Ordering</a></code></h4>
|
||
</div><h3 class='impl'><code>impl <a class='trait' href='../../../bitflags/__core/cmp/trait.Eq.html' title='bitflags::__core::cmp::Eq'>Eq</a> for <a class='struct' href='../../../bitflags/__core/ffi/struct.CString.html' title='bitflags::__core::ffi::CString'>CString</a></code></h3><div class='impl-items'></div><h3 class='impl'><code>impl <a class='trait' href='../../../bitflags/__core/cmp/trait.PartialOrd.html' title='bitflags::__core::cmp::PartialOrd'>PartialOrd</a><<a class='struct' href='../../../bitflags/__core/ffi/struct.CString.html' title='bitflags::__core::ffi::CString'>CString</a>> for <a class='struct' href='../../../bitflags/__core/ffi/struct.CString.html' title='bitflags::__core::ffi::CString'>CString</a></code></h3><div class='impl-items'><h4 id='method.partial_cmp' class='method'><code>fn <a href='../../../bitflags/__core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, __arg_0: &<a class='struct' href='../../../bitflags/__core/ffi/struct.CString.html' title='bitflags::__core::ffi::CString'>CString</a>) -> <a class='enum' href='../../../bitflags/__core/option/enum.Option.html' title='bitflags::__core::option::Option'>Option</a><<a class='enum' href='../../../bitflags/__core/cmp/enum.Ordering.html' title='bitflags::__core::cmp::Ordering'>Ordering</a>></code></h4>
|
||
<h4 id='method.lt' class='method'><code>fn <a href='../../../bitflags/__core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, __arg_0: &<a class='struct' href='../../../bitflags/__core/ffi/struct.CString.html' title='bitflags::__core::ffi::CString'>CString</a>) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.bool.html'>bool</a></code></h4>
|
||
<h4 id='method.le' class='method'><code>fn <a href='../../../bitflags/__core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, __arg_0: &<a class='struct' href='../../../bitflags/__core/ffi/struct.CString.html' title='bitflags::__core::ffi::CString'>CString</a>) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.bool.html'>bool</a></code></h4>
|
||
<h4 id='method.gt' class='method'><code>fn <a href='../../../bitflags/__core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, __arg_0: &<a class='struct' href='../../../bitflags/__core/ffi/struct.CString.html' title='bitflags::__core::ffi::CString'>CString</a>) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.bool.html'>bool</a></code></h4>
|
||
<h4 id='method.ge' class='method'><code>fn <a href='../../../bitflags/__core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, __arg_0: &<a class='struct' href='../../../bitflags/__core/ffi/struct.CString.html' title='bitflags::__core::ffi::CString'>CString</a>) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.bool.html'>bool</a></code></h4>
|
||
</div><h3 class='impl'><code>impl <a class='trait' href='../../../bitflags/__core/cmp/trait.PartialEq.html' title='bitflags::__core::cmp::PartialEq'>PartialEq</a><<a class='struct' href='../../../bitflags/__core/ffi/struct.CString.html' title='bitflags::__core::ffi::CString'>CString</a>> for <a class='struct' href='../../../bitflags/__core/ffi/struct.CString.html' title='bitflags::__core::ffi::CString'>CString</a></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../../bitflags/__core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, __arg_0: &<a class='struct' href='../../../bitflags/__core/ffi/struct.CString.html' title='bitflags::__core::ffi::CString'>CString</a>) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.bool.html'>bool</a></code></h4>
|
||
<h4 id='method.ne' class='method'><code>fn <a href='../../../bitflags/__core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, __arg_0: &<a class='struct' href='../../../bitflags/__core/ffi/struct.CString.html' title='bitflags::__core::ffi::CString'>CString</a>) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.bool.html'>bool</a></code></h4>
|
||
</div></section>
|
||
<section id='search' class="content hidden"></section>
|
||
|
||
<section class="footer"></section>
|
||
|
||
<aside id="help" class="hidden">
|
||
<div>
|
||
<h1 class="hidden">Help</h1>
|
||
|
||
<div class="shortcuts">
|
||
<h2>Keyboard Shortcuts</h2>
|
||
|
||
<dl>
|
||
<dt>?</dt>
|
||
<dd>Show this help dialog</dd>
|
||
<dt>S</dt>
|
||
<dd>Focus the search field</dd>
|
||
<dt>⇤</dt>
|
||
<dd>Move up in search results</dd>
|
||
<dt>⇥</dt>
|
||
<dd>Move down in search results</dd>
|
||
<dt>⏎</dt>
|
||
<dd>Go to active search result</dd>
|
||
</dl>
|
||
</div>
|
||
|
||
<div class="infos">
|
||
<h2>Search Tricks</h2>
|
||
|
||
<p>
|
||
Prefix searches with a type followed by a colon (e.g.
|
||
<code>fn:</code>) to restrict the search to a given type.
|
||
</p>
|
||
|
||
<p>
|
||
Accepted types are: <code>fn</code>, <code>mod</code>,
|
||
<code>struct</code>, <code>enum</code>,
|
||
<code>trait</code>, <code>type</code>, <code>macro</code>,
|
||
and <code>const</code>.
|
||
</p>
|
||
|
||
<p>
|
||
Search functions by type signature (e.g.
|
||
<code>vec -> usize</code> or <code>* -> vec</code>)
|
||
</p>
|
||
</div>
|
||
</div>
|
||
</aside>
|
||
|
||
|
||
|
||
<script>
|
||
window.rootPath = "../../../";
|
||
window.currentCrate = "bitflags";
|
||
window.playgroundUrl = "";
|
||
</script>
|
||
<script src="../../../jquery.js"></script>
|
||
<script src="../../../main.js"></script>
|
||
|
||
<script defer src="../../../search-index.js"></script>
|
||
</body>
|
||
</html> |