Sophie

Sophie

distrib > Mageia > 6 > armv7hl > media > core-updates > by-pkgid > 4e2dbb669434a7691662cb2f0ad38972 > files > 231

rust-doc-1.28.0-1.mga6.armv7hl.rpm

<!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 `alloc` crate."><meta name="keywords" content="rust, rustlang, rust-lang, alloc"><title>alloc - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><link rel="shortcut icon" href="https://doc.rust-lang.org/favicon.ico"></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../alloc/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='logo' width='100'></a><p class='location'>Crate alloc</p><div class='block version'><p>Version 1.28.0</p></div>
                        <a id='all-types' href='all.html'><p>See all alloc's items</p></a><div class="sidebar-elems"><div class="block items"><ul><li><a href="#reexports">Re-exports</a></li><li><a href="#modules">Modules</a></li><li><a href="#macros">Macros</a></li></ul></div><p class='location'></p><script>window.sidebarCurrent = {name: 'alloc', ty: 'mod', relpath: '../'};</script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><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"><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='in-band'>Crate <a class="mod" href=''>alloc</a></span><span class='out-of-band'><span class='since' title='Stable since Rust version '></span><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../src/alloc/lib.rs.html#11-227' title='goto source code'>[src]</a></span></h1><div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>alloc </code><a href="https://github.com/rust-lang/rust/issues/27783">#27783</a>)</summary><p>this library is unlikely to be stabilized in its current form or name</p>
</details></div></div><div class='docblock'><h1 id="the-rust-core-allocation-and-collections-library" class="section-header"><a href="#the-rust-core-allocation-and-collections-library">The Rust core allocation and collections library</a></h1>
<p>This library provides smart pointers and collections for managing
heap-allocated values.</p>
<p>This library, like libcore, is not intended for general usage, but rather as
a building block of other libraries. The types and interfaces in this
library are re-exported through the <a href="../std/index.html">standard library</a>,
and should not be used through this library.</p>
<h2 id="boxed-values" class="section-header"><a href="#boxed-values">Boxed values</a></h2>
<p>The <a href="boxed/index.html"><code>Box</code></a> type is a smart pointer type. There can
only be one owner of a <code>Box</code>, and the owner can decide to mutate the
contents, which live on the heap.</p>
<p>This type can be sent among threads efficiently as the size of a <code>Box</code> value
is the same as that of a pointer. Tree-like data structures are often built
with boxes because each node often has only one owner, the parent.</p>
<h2 id="reference-counted-pointers" class="section-header"><a href="#reference-counted-pointers">Reference counted pointers</a></h2>
<p>The <a href="rc/index.html"><code>Rc</code></a> type is a non-threadsafe reference-counted pointer
type intended for sharing memory within a thread. An <code>Rc</code> pointer wraps a
type, <code>T</code>, and only allows access to <code>&amp;T</code>, a shared reference.</p>
<p>This type is useful when inherited mutability (such as using <code>Box</code>) is too
constraining for an application, and is often paired with the <code>Cell</code> or
<code>RefCell</code> types in order to allow mutation.</p>
<h2 id="atomically-reference-counted-pointers" class="section-header"><a href="#atomically-reference-counted-pointers">Atomically reference counted pointers</a></h2>
<p>The <a href="arc/index.html"><code>Arc</code></a> type is the threadsafe equivalent of the <code>Rc</code>
type. It provides all the same functionality of <code>Rc</code>, except it requires
that the contained type <code>T</code> is shareable. Additionally, <code>Arc&lt;T&gt;</code> is itself
sendable while <code>Rc&lt;T&gt;</code> is not.</p>
<p>This type allows for shared access to the contained data, and is often
paired with synchronization primitives such as mutexes to allow mutation of
shared resources.</p>
<h2 id="collections" class="section-header"><a href="#collections">Collections</a></h2>
<p>Implementations of the most common general purpose data structures are
defined in this library. They are re-exported through the
<a href="../std/collections/index.html">standard collections library</a>.</p>
<h2 id="heap-interfaces" class="section-header"><a href="#heap-interfaces">Heap interfaces</a></h2>
<p>The <a href="alloc/index.html"><code>alloc</code></a> module defines the low-level interface to the
default global allocator. It is not compatible with the libc allocator API.</p>
</div><h2 id='reexports' class='section-header'><a href="#reexports">Re-exports</a></h2>
<table><tr><td><code>pub use binary_heap::<a class="struct" href="../alloc/binary_heap/struct.BinaryHeap.html" title="struct alloc::binary_heap::BinaryHeap">BinaryHeap</a>;</code></td></tr><tr><td><code>pub use btree_map::<a class="struct" href="../alloc/btree_map/struct.BTreeMap.html" title="struct alloc::btree_map::BTreeMap">BTreeMap</a>;</code></td></tr><tr><td><code>pub use btree_set::<a class="struct" href="../alloc/btree_set/struct.BTreeSet.html" title="struct alloc::btree_set::BTreeSet">BTreeSet</a>;</code></td></tr><tr><td><code>pub use linked_list::<a class="struct" href="../alloc/linked_list/struct.LinkedList.html" title="struct alloc::linked_list::LinkedList">LinkedList</a>;</code></td></tr><tr><td><code>pub use vec_deque::<a class="struct" href="../alloc/vec_deque/struct.VecDeque.html" title="struct alloc::vec_deque::VecDeque">VecDeque</a>;</code></td></tr><tr><td><code>pub use string::<a class="struct" href="../alloc/string/struct.String.html" title="struct alloc::string::String">String</a>;</code></td></tr><tr><td><code>pub use vec::<a class="struct" href="../alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>;</code></td></tr></table><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
<table>
                       <tr class=' module-item'>
                           <td><a class="mod" href="alloc/index.html"
                                  title='mod alloc::alloc'>alloc</a></td>
                           <td class='docblock-short'>
                                <p>Memory allocation APIs</p>

                           </td>
                       </tr>
                       <tr class=' module-item'>
                           <td><a class="mod" href="arc/index.html"
                                  title='mod alloc::arc'>arc</a></td>
                           <td class='docblock-short'>
                                <p>Thread-safe reference-counting pointers.</p>

                           </td>
                       </tr>
                       <tr class=' module-item'>
                           <td><a class="mod" href="binary_heap/index.html"
                                  title='mod alloc::binary_heap'>binary_heap</a></td>
                           <td class='docblock-short'>
                                <p>A priority queue implemented with a binary heap.</p>

                           </td>
                       </tr>
                       <tr class=' module-item'>
                           <td><a class="mod" href="borrow/index.html"
                                  title='mod alloc::borrow'>borrow</a></td>
                           <td class='docblock-short'>
                                <p>A module for working with borrowed data.</p>

                           </td>
                       </tr>
                       <tr class=' module-item'>
                           <td><a class="mod" href="boxed/index.html"
                                  title='mod alloc::boxed'>boxed</a></td>
                           <td class='docblock-short'>
                                <p>A pointer type for heap allocation.</p>

                           </td>
                       </tr>
                       <tr class=' module-item'>
                           <td><a class="mod" href="btree_map/index.html"
                                  title='mod alloc::btree_map'>btree_map</a></td>
                           <td class='docblock-short'>
                                <p>A map based on a B-Tree.</p>

                           </td>
                       </tr>
                       <tr class=' module-item'>
                           <td><a class="mod" href="btree_set/index.html"
                                  title='mod alloc::btree_set'>btree_set</a></td>
                           <td class='docblock-short'>
                                <p>A set based on a B-Tree.</p>

                           </td>
                       </tr>
                       <tr class=' module-item'>
                           <td><a class="mod" href="fmt/index.html"
                                  title='mod alloc::fmt'>fmt</a></td>
                           <td class='docblock-short'>
                                <p>Utilities for formatting and printing <code>String</code>s.</p>

                           </td>
                       </tr>
                       <tr class=' module-item'>
                           <td><a class="mod" href="linked_list/index.html"
                                  title='mod alloc::linked_list'>linked_list</a></td>
                           <td class='docblock-short'>
                                <p>A doubly-linked list with owned nodes.</p>

                           </td>
                       </tr>
                       <tr class=' module-item'>
                           <td><a class="mod" href="rc/index.html"
                                  title='mod alloc::rc'>rc</a></td>
                           <td class='docblock-short'>
                                <p>Single-threaded reference-counting pointers. 'Rc' stands for 'Reference
Counted'.</p>

                           </td>
                       </tr>
                       <tr class=' module-item'>
                           <td><a class="mod" href="slice/index.html"
                                  title='mod alloc::slice'>slice</a></td>
                           <td class='docblock-short'>
                                <p>A dynamically-sized view into a contiguous sequence, <code>[T]</code>.</p>

                           </td>
                       </tr>
                       <tr class=' module-item'>
                           <td><a class="mod" href="str/index.html"
                                  title='mod alloc::str'>str</a></td>
                           <td class='docblock-short'>
                                <p>Unicode string slices.</p>

                           </td>
                       </tr>
                       <tr class=' module-item'>
                           <td><a class="mod" href="string/index.html"
                                  title='mod alloc::string'>string</a></td>
                           <td class='docblock-short'>
                                <p>A UTF-8 encoded, growable string.</p>

                           </td>
                       </tr>
                       <tr class=' module-item'>
                           <td><a class="mod" href="vec/index.html"
                                  title='mod alloc::vec'>vec</a></td>
                           <td class='docblock-short'>
                                <p>A contiguous growable array type with heap-allocated contents, written
<code>Vec&lt;T&gt;</code>.</p>

                           </td>
                       </tr>
                       <tr class=' module-item'>
                           <td><a class="mod" href="vec_deque/index.html"
                                  title='mod alloc::vec_deque'>vec_deque</a></td>
                           <td class='docblock-short'>
                                <p>A double-ended queue implemented with a growable ring buffer.</p>

                           </td>
                       </tr>
                       <tr class='unstable deprecated module-item'>
                           <td><a class="mod" href="allocator/index.html"
                                  title='mod alloc::allocator'>allocator</a></td>
                           <td class='docblock-short'>
                               [<div class='stab deprecated'>Deprecated</div>] [<div class='stab unstable'>Experimental</div>] <p>Use the <code>alloc</code> module instead.</p>

                           </td>
                       </tr>
                       <tr class='unstable module-item'>
                           <td><a class="mod" href="raw_vec/index.html"
                                  title='mod alloc::raw_vec'>raw_vec</a></td>
                           <td class='docblock-short'>
                               [<div class='stab unstable'>Experimental</div>] 
                           </td>
                       </tr>
                       <tr class='unstable module-item'>
                           <td><a class="mod" href="task/index.html"
                                  title='mod alloc::task'>task</a></td>
                           <td class='docblock-short'>
                               [<div class='stab unstable'>Experimental</div>] <p>Types and Traits for working with asynchronous tasks.</p>

                           </td>
                       </tr></table><h2 id='macros' class='section-header'><a href="#macros">Macros</a></h2>
<table>
                       <tr class=' module-item'>
                           <td><a class="macro" href="macro.format.html"
                                  title='macro alloc::format'>format</a></td>
                           <td class='docblock-short'>
                                <p>Creates a <code>String</code> using interpolation of runtime expressions.</p>

                           </td>
                       </tr>
                       <tr class=' module-item'>
                           <td><a class="macro" href="macro.vec.html"
                                  title='macro alloc::vec'>vec</a></td>
                           <td class='docblock-short'>
                                <p>Creates a <a href="../std/vec/struct.Vec.html"><code>Vec</code></a> containing the arguments.</p>

                           </td>
                       </tr></table></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><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>&#9166;</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</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><p>Search multiple things at once by splitting your query with comma (e.g. <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "alloc";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>