Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > 0c2243f8a1696816431e7210e991fa52 > files > 14295

rust-doc-1.35.0-1.mga7.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 `System` struct in crate `std`."><meta name="keywords" content="rust, rustlang, rust-lang, System"><title>std::alloc::System - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize1.35.0.css"><link rel="stylesheet" type="text/css" href="../../rustdoc1.35.0.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark1.35.0.css"><link rel="stylesheet" type="text/css" href="../../light1.35.0.css" id="themeStyle"><script src="../../storage1.35.0.js"></script><noscript><link rel="stylesheet" href="../../noscript1.35.0.css"></noscript><link rel="shortcut icon" href="../../favicon1.35.0.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow1.35.0.svg");}</style></head><body class="rustdoc struct"><!--[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='../../std/index.html'><img src='../../rust-logo1.35.0.png' alt='logo' width='100'></a><p class='location'>Struct System</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Alloc">Alloc</a><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-GlobalAlloc">GlobalAlloc</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow">Borrow</a><a href="#impl-BorrowMut">BorrowMut</a><a href="#impl-From">From</a><a href="#impl-Into">Into</a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom">TryFrom</a><a href="#impl-TryInto">TryInto</a></div></div><p class='location'><a href='../index.html'>std</a>::<wbr><a href='index.html'>alloc</a></p><script>window.sidebarCurrent = {name: 'System', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush1.35.0.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme1.35.0.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel1.35.0.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span class='since' title='Stable since Rust version 1.28.0'>1.28.0</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/std/alloc.rs.html#134' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../index.html'>std</a>::<wbr><a href='index.html'>alloc</a>::<wbr><a class="struct" href=''>System</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct System;</pre></div><div class='docblock'><p>The default memory allocator provided by the operating system.</p>
<p>This is based on <code>malloc</code> on Unix platforms and <code>HeapAlloc</code> on Windows,
plus related functions.</p>
<p>This type implements the <code>GlobalAlloc</code> trait and Rust programs by default
work as if they had this definition:</p>

<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">alloc</span>::<span class="ident">System</span>;

<span class="attribute">#[<span class="ident">global_allocator</span>]</span>
<span class="kw">static</span> <span class="ident">A</span>: <span class="ident">System</span> <span class="op">=</span> <span class="ident">System</span>;

<span class="kw">fn</span> <span class="ident">main</span>() {
    <span class="kw">let</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">Box</span>::<span class="ident">new</span>(<span class="number">4</span>); <span class="comment">// Allocates from the system allocator.</span>
    <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">a</span>);
}<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Ause%20std%3A%3Aalloc%3A%3ASystem%3B%0A%0A%23%5Bglobal_allocator%5D%0Astatic%20A%3A%20System%20%3D%20System%3B%0A%0Afn%20main()%20%7B%0A%20%20%20%20let%20a%20%3D%20Box%3A%3Anew(4)%3B%20%2F%2F%20Allocates%20from%20the%20system%20allocator.%0A%20%20%20%20println!(%22%7B%7D%22%2C%20a)%3B%0A%7D">Run</a></pre></div>
<p>You can also define your own wrapper around <code>System</code> if you'd like, such as
keeping track of the number of all bytes allocated:</p>

<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">alloc</span>::{<span class="ident">System</span>, <span class="ident">GlobalAlloc</span>, <span class="ident">Layout</span>};
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">atomic</span>::{<span class="ident">AtomicUsize</span>, <span class="ident">Ordering</span>::<span class="ident">SeqCst</span>};

<span class="kw">struct</span> <span class="ident">Counter</span>;

<span class="kw">static</span> <span class="ident">ALLOCATED</span>: <span class="ident">AtomicUsize</span> <span class="op">=</span> <span class="ident">AtomicUsize</span>::<span class="ident">new</span>(<span class="number">0</span>);

<span class="kw">unsafe</span> <span class="kw">impl</span> <span class="ident">GlobalAlloc</span> <span class="kw">for</span> <span class="ident">Counter</span> {
    <span class="kw">unsafe</span> <span class="kw">fn</span> <span class="ident">alloc</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">layout</span>: <span class="ident">Layout</span>) <span class="op">-&gt;</span> <span class="kw-2">*</span><span class="kw-2">mut</span> <span class="ident">u8</span> {
        <span class="kw">let</span> <span class="ident">ret</span> <span class="op">=</span> <span class="ident">System</span>.<span class="ident">alloc</span>(<span class="ident">layout</span>);
        <span class="kw">if</span> <span class="op">!</span><span class="ident">ret</span>.<span class="ident">is_null</span>() {
            <span class="ident">ALLOCATED</span>.<span class="ident">fetch_add</span>(<span class="ident">layout</span>.<span class="ident">size</span>(), <span class="ident">SeqCst</span>);
        }
        <span class="kw">return</span> <span class="ident">ret</span>
    }

    <span class="kw">unsafe</span> <span class="kw">fn</span> <span class="ident">dealloc</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">ptr</span>: <span class="kw-2">*</span><span class="kw-2">mut</span> <span class="ident">u8</span>, <span class="ident">layout</span>: <span class="ident">Layout</span>) {
        <span class="ident">System</span>.<span class="ident">dealloc</span>(<span class="ident">ptr</span>, <span class="ident">layout</span>);
        <span class="ident">ALLOCATED</span>.<span class="ident">fetch_sub</span>(<span class="ident">layout</span>.<span class="ident">size</span>(), <span class="ident">SeqCst</span>);
    }
}

<span class="attribute">#[<span class="ident">global_allocator</span>]</span>
<span class="kw">static</span> <span class="ident">A</span>: <span class="ident">Counter</span> <span class="op">=</span> <span class="ident">Counter</span>;

<span class="kw">fn</span> <span class="ident">main</span>() {
    <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;allocated bytes before main: {}&quot;</span>, <span class="ident">ALLOCATED</span>.<span class="ident">load</span>(<span class="ident">SeqCst</span>));
}<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Ause%20std%3A%3Aalloc%3A%3A%7BSystem%2C%20GlobalAlloc%2C%20Layout%7D%3B%0Ause%20std%3A%3Async%3A%3Aatomic%3A%3A%7BAtomicUsize%2C%20Ordering%3A%3ASeqCst%7D%3B%0A%0Astruct%20Counter%3B%0A%0Astatic%20ALLOCATED%3A%20AtomicUsize%20%3D%20AtomicUsize%3A%3Anew(0)%3B%0A%0Aunsafe%20impl%20GlobalAlloc%20for%20Counter%20%7B%0A%20%20%20%20unsafe%20fn%20alloc(%26self%2C%20layout%3A%20Layout)%20-%3E%20*mut%20u8%20%7B%0A%20%20%20%20%20%20%20%20let%20ret%20%3D%20System.alloc(layout)%3B%0A%20%20%20%20%20%20%20%20if%20!ret.is_null()%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20ALLOCATED.fetch_add(layout.size()%2C%20SeqCst)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20return%20ret%0A%20%20%20%20%7D%0A%0A%20%20%20%20unsafe%20fn%20dealloc(%26self%2C%20ptr%3A%20*mut%20u8%2C%20layout%3A%20Layout)%20%7B%0A%20%20%20%20%20%20%20%20System.dealloc(ptr%2C%20layout)%3B%0A%20%20%20%20%20%20%20%20ALLOCATED.fetch_sub(layout.size()%2C%20SeqCst)%3B%0A%20%20%20%20%7D%0A%7D%0A%0A%23%5Bglobal_allocator%5D%0Astatic%20A%3A%20Counter%20%3D%20Counter%3B%0A%0Afn%20main()%20%7B%0A%20%20%20%20println!(%22allocated%20bytes%20before%20main%3A%20%7B%7D%22%2C%20ALLOCATED.load(SeqCst))%3B%0A%7D">Run</a></pre></div>
<p>It can also be used directly to allocate memory independently of whatever
global allocator has been selected for a Rust program. For example if a Rust
program opts in to using jemalloc as the global allocator, <code>System</code> will
still allocate memory using <code>malloc</code> and <code>HeapAlloc</code>.</p>
</div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Copy' class='impl'><code class='in-band'>impl <a class="trait" href="../../std/marker/trait.Copy.html" title="trait std::marker::Copy">Copy</a> for <a class="struct" href="../../std/alloc/struct.System.html" title="struct std::alloc::System">System</a></code><a href='#impl-Copy' class='anchor'></a><a class='srclink' href='../../src/std/alloc.rs.html#133' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="../../std/fmt/trait.Debug.html" title="trait std::fmt::Debug">Debug</a> for <a class="struct" href="../../std/alloc/struct.System.html" title="struct std::alloc::System">System</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../src/std/alloc.rs.html#133' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='../../std/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="../../std/fmt/struct.Formatter.html" title="struct std::fmt::Formatter">Formatter</a>) -&gt; <a class="type" href="../../std/fmt/type.Result.html" title="type std::fmt::Result">Result</a></code><a class='srclink' href='../../src/std/alloc.rs.html#133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="../../std/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="../../std/clone/trait.Clone.html" title="trait std::clone::Clone">Clone</a> for <a class="struct" href="../../std/alloc/struct.System.html" title="struct std::alloc::System">System</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../src/std/alloc.rs.html#133' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='../../std/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class="struct" href="../../std/alloc/struct.System.html" title="struct std::alloc::System">System</a></code><a class='srclink' href='../../src/std/alloc.rs.html#133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="../../std/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id='method.clone_from' class="method"><code id='clone_from.v'>fn <a href='../../std/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: <a class="primitive" href="../primitive.reference.html">&amp;</a>Self)</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='../../src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="../../std/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl <a class="trait" href="../../std/default/trait.Default.html" title="trait std::default::Default">Default</a> for <a class="struct" href="../../std/alloc/struct.System.html" title="struct std::alloc::System">System</a></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../../src/std/alloc.rs.html#133' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code id='default.v'>fn <a href='../../std/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -&gt; <a class="struct" href="../../std/alloc/struct.System.html" title="struct std::alloc::System">System</a></code><a class='srclink' href='../../src/std/alloc.rs.html#133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the &quot;default value&quot; for a type. <a href="../../std/default/trait.Default.html#tymethod.default">Read more</a></p>
</div></div><h3 id='impl-GlobalAlloc' class='impl'><code class='in-band'>impl <a class="trait" href="../../std/alloc/trait.GlobalAlloc.html" title="trait std::alloc::GlobalAlloc">GlobalAlloc</a> for <a class="struct" href="../../std/alloc/struct.System.html" title="struct std::alloc::System">System</a></code><a href='#impl-GlobalAlloc' class='anchor'></a><a class='srclink' href='../../src/std/sys/unix/alloc.rs.html#6-48' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.alloc' class="method hidden"><code id='alloc.v'>unsafe fn <a href='../../std/alloc/trait.GlobalAlloc.html#tymethod.alloc' class='fnname'>alloc</a>(&amp;self, layout: <a class="struct" href="../../std/alloc/struct.Layout.html" title="struct std::alloc::Layout">Layout</a>) -&gt; <a class="primitive" href="../primitive.pointer.html">*mut </a><a class="primitive" href="../primitive.u8.html">u8</a></code><a class='srclink' href='../../src/std/sys/unix/alloc.rs.html#8-20' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Allocate memory as described by the given <code>layout</code>. <a href="../../std/alloc/trait.GlobalAlloc.html#tymethod.alloc">Read more</a></p>
</div><h4 id='method.alloc_zeroed' class="method hidden"><code id='alloc_zeroed.v'>unsafe fn <a href='../../std/alloc/trait.GlobalAlloc.html#method.alloc_zeroed' class='fnname'>alloc_zeroed</a>(&amp;self, layout: <a class="struct" href="../../std/alloc/struct.Layout.html" title="struct std::alloc::Layout">Layout</a>) -&gt; <a class="primitive" href="../primitive.pointer.html">*mut </a><a class="primitive" href="../primitive.u8.html">u8</a></code><a class='srclink' href='../../src/std/sys/unix/alloc.rs.html#23-33' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Behaves like <code>alloc</code>, but also ensures that the contents are set to zero before being returned. <a href="../../std/alloc/trait.GlobalAlloc.html#method.alloc_zeroed">Read more</a></p>
</div><h4 id='method.dealloc' class="method hidden"><code id='dealloc.v'>unsafe fn <a href='../../std/alloc/trait.GlobalAlloc.html#tymethod.dealloc' class='fnname'>dealloc</a>(&amp;self, ptr: <a class="primitive" href="../primitive.pointer.html">*mut </a><a class="primitive" href="../primitive.u8.html">u8</a>, _layout: <a class="struct" href="../../std/alloc/struct.Layout.html" title="struct std::alloc::Layout">Layout</a>)</code><a class='srclink' href='../../src/std/sys/unix/alloc.rs.html#36-38' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Deallocate the block of memory at the given <code>ptr</code> pointer with the given <code>layout</code>. <a href="../../std/alloc/trait.GlobalAlloc.html#tymethod.dealloc">Read more</a></p>
</div><h4 id='method.realloc' class="method hidden"><code id='realloc.v'>unsafe fn <a href='../../std/alloc/trait.GlobalAlloc.html#method.realloc' class='fnname'>realloc</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;ptr: <a class="primitive" href="../primitive.pointer.html">*mut </a><a class="primitive" href="../primitive.u8.html">u8</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;layout: <a class="struct" href="../../std/alloc/struct.Layout.html" title="struct std::alloc::Layout">Layout</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;new_size: <a class="primitive" href="../primitive.usize.html">usize</a><br>) -&gt; <a class="primitive" href="../primitive.pointer.html">*mut </a><a class="primitive" href="../primitive.u8.html">u8</a></code><a class='srclink' href='../../src/std/sys/unix/alloc.rs.html#41-47' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Shrink or grow a block of memory to the given <code>new_size</code>. The block is described by the given <code>ptr</code> pointer and <code>layout</code>. <a href="../../std/alloc/trait.GlobalAlloc.html#method.realloc">Read more</a></p>
</div></div><h3 id='impl-Alloc' class='impl'><code class='in-band'>impl <a class="trait" href="../../std/alloc/trait.Alloc.html" title="trait std::alloc::Alloc">Alloc</a> for <a class="struct" href="../../std/alloc/struct.System.html" title="struct std::alloc::System">System</a></code><a href='#impl-Alloc' class='anchor'></a><a class='srclink' href='../../src/std/alloc.rs.html#138-161' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.alloc-1' class="method hidden"><code id='alloc.v-1'>unsafe fn <a href='../../std/alloc/trait.Alloc.html#tymethod.alloc' class='fnname'>alloc</a>(&amp;mut self, layout: <a class="struct" href="../../std/alloc/struct.Layout.html" title="struct std::alloc::Layout">Layout</a>) -&gt; <a class="enum" href="../../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;<a class="struct" href="../../std/ptr/struct.NonNull.html" title="struct std::ptr::NonNull">NonNull</a>&lt;<a class="primitive" href="../primitive.u8.html">u8</a>&gt;, <a class="struct" href="../../std/alloc/struct.AllocErr.html" title="struct std::alloc::AllocErr">AllocErr</a>&gt;</code><a class='srclink' href='../../src/std/alloc.rs.html#140-142' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>allocator_api</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</div></div><div class='docblock hidden'><p>Returns a pointer meeting the size and alignment guarantees of <code>layout</code>. <a href="../../std/alloc/trait.Alloc.html#tymethod.alloc">Read more</a></p>
</div><h4 id='method.alloc_zeroed-1' class="method hidden"><code id='alloc_zeroed.v-1'>unsafe fn <a href='../../std/alloc/trait.Alloc.html#method.alloc_zeroed' class='fnname'>alloc_zeroed</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;layout: <a class="struct" href="../../std/alloc/struct.Layout.html" title="struct std::alloc::Layout">Layout</a><br>) -&gt; <a class="enum" href="../../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;<a class="struct" href="../../std/ptr/struct.NonNull.html" title="struct std::ptr::NonNull">NonNull</a>&lt;<a class="primitive" href="../primitive.u8.html">u8</a>&gt;, <a class="struct" href="../../std/alloc/struct.AllocErr.html" title="struct std::alloc::AllocErr">AllocErr</a>&gt;</code><a class='srclink' href='../../src/std/alloc.rs.html#145-147' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>allocator_api</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</div></div><div class='docblock hidden'><p>Behaves like <code>alloc</code>, but also ensures that the contents are set to zero before being returned. <a href="../../std/alloc/trait.Alloc.html#method.alloc_zeroed">Read more</a></p>
</div><h4 id='method.dealloc-1' class="method hidden"><code id='dealloc.v-1'>unsafe fn <a href='../../std/alloc/trait.Alloc.html#tymethod.dealloc' class='fnname'>dealloc</a>(&amp;mut self, ptr: <a class="struct" href="../../std/ptr/struct.NonNull.html" title="struct std::ptr::NonNull">NonNull</a>&lt;<a class="primitive" href="../primitive.u8.html">u8</a>&gt;, layout: <a class="struct" href="../../std/alloc/struct.Layout.html" title="struct std::alloc::Layout">Layout</a>)</code><a class='srclink' href='../../src/std/alloc.rs.html#150-152' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>allocator_api</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</div></div><div class='docblock hidden'><p>Deallocate the memory referenced by <code>ptr</code>. <a href="../../std/alloc/trait.Alloc.html#tymethod.dealloc">Read more</a></p>
</div><h4 id='method.realloc-1' class="method hidden"><code id='realloc.v-1'>unsafe fn <a href='../../std/alloc/trait.Alloc.html#method.realloc' class='fnname'>realloc</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;ptr: <a class="struct" href="../../std/ptr/struct.NonNull.html" title="struct std::ptr::NonNull">NonNull</a>&lt;<a class="primitive" href="../primitive.u8.html">u8</a>&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;layout: <a class="struct" href="../../std/alloc/struct.Layout.html" title="struct std::alloc::Layout">Layout</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;new_size: <a class="primitive" href="../primitive.usize.html">usize</a><br>) -&gt; <a class="enum" href="../../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;<a class="struct" href="../../std/ptr/struct.NonNull.html" title="struct std::ptr::NonNull">NonNull</a>&lt;<a class="primitive" href="../primitive.u8.html">u8</a>&gt;, <a class="struct" href="../../std/alloc/struct.AllocErr.html" title="struct std::alloc::AllocErr">AllocErr</a>&gt;</code><a class='srclink' href='../../src/std/alloc.rs.html#155-160' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>allocator_api</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</div></div><div class='docblock hidden'><p>Returns a pointer suitable for holding data described by a new layout with <code>layout</code>’s alignment and a size given by <code>new_size</code>. To accomplish this, this may extend or shrink the allocation referenced by <code>ptr</code> to fit the new layout. <a href="../../std/alloc/trait.Alloc.html#method.realloc">Read more</a></p>
</div><h4 id='method.usable_size' class="method"><code id='usable_size.v'>fn <a href='../../std/alloc/trait.Alloc.html#method.usable_size' class='fnname'>usable_size</a>(&amp;self, layout: &amp;<a class="struct" href="../../std/alloc/struct.Layout.html" title="struct std::alloc::Layout">Layout</a>) -&gt; <a class="primitive" href="../primitive.tuple.html">(</a><a class="primitive" href="../primitive.usize.html">usize</a>, <a class="primitive" href="../primitive.usize.html">usize</a><a class="primitive" href="../primitive.tuple.html">)</a></code><a class='srclink' href='../../src/core/alloc.rs.html#759-761' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>allocator_api</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</div></div><div class='docblock'><p>Returns bounds on the guaranteed usable size of a successful allocation created with the specified <code>layout</code>. <a href="../../std/alloc/trait.Alloc.html#method.usable_size">Read more</a></p>
</div><h4 id='method.alloc_excess' class="method"><code id='alloc_excess.v'>unsafe fn <a href='../../std/alloc/trait.Alloc.html#method.alloc_excess' class='fnname'>alloc_excess</a>(&amp;mut self, layout: <a class="struct" href="../../std/alloc/struct.Layout.html" title="struct std::alloc::Layout">Layout</a>) -&gt; <a class="enum" href="../../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;<a class="struct" href="../../std/alloc/struct.Excess.html" title="struct std::alloc::Excess">Excess</a>, <a class="struct" href="../../std/alloc/struct.AllocErr.html" title="struct std::alloc::AllocErr">AllocErr</a>&gt;</code><a class='srclink' href='../../src/core/alloc.rs.html#894-897' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>allocator_api</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</div></div><div class='docblock'><p>Behaves like <code>alloc</code>, but also returns the whole size of the returned block. For some <code>layout</code> inputs, like arrays, this may include extra storage usable for additional data. <a href="../../std/alloc/trait.Alloc.html#method.alloc_excess">Read more</a></p>
</div><h4 id='method.realloc_excess' class="method"><code id='realloc_excess.v'>unsafe fn <a href='../../std/alloc/trait.Alloc.html#method.realloc_excess' class='fnname'>realloc_excess</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;ptr: <a class="struct" href="../../std/ptr/struct.NonNull.html" title="struct std::ptr::NonNull">NonNull</a>&lt;<a class="primitive" href="../primitive.u8.html">u8</a>&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;layout: <a class="struct" href="../../std/alloc/struct.Layout.html" title="struct std::alloc::Layout">Layout</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;new_size: <a class="primitive" href="../primitive.usize.html">usize</a><br>) -&gt; <a class="enum" href="../../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;<a class="struct" href="../../std/alloc/struct.Excess.html" title="struct std::alloc::Excess">Excess</a>, <a class="struct" href="../../std/alloc/struct.AllocErr.html" title="struct std::alloc::AllocErr">AllocErr</a>&gt;</code><a class='srclink' href='../../src/core/alloc.rs.html#918-926' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>allocator_api</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</div></div><div class='docblock'><p>Behaves like <code>realloc</code>, but also returns the whole size of the returned block. For some <code>layout</code> inputs, like arrays, this may include extra storage usable for additional data. <a href="../../std/alloc/trait.Alloc.html#method.realloc_excess">Read more</a></p>
</div><h4 id='method.grow_in_place' class="method"><code id='grow_in_place.v'>unsafe fn <a href='../../std/alloc/trait.Alloc.html#method.grow_in_place' class='fnname'>grow_in_place</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;ptr: <a class="struct" href="../../std/ptr/struct.NonNull.html" title="struct std::ptr::NonNull">NonNull</a>&lt;<a class="primitive" href="../primitive.u8.html">u8</a>&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;layout: <a class="struct" href="../../std/alloc/struct.Layout.html" title="struct std::alloc::Layout">Layout</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;new_size: <a class="primitive" href="../primitive.usize.html">usize</a><br>) -&gt; <a class="enum" href="../../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;<a class="primitive" href="../primitive.unit.html">()</a>, <a class="struct" href="../../std/alloc/struct.CannotReallocInPlace.html" title="struct std::alloc::CannotReallocInPlace">CannotReallocInPlace</a>&gt;</code><a class='srclink' href='../../src/core/alloc.rs.html#963-977' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>allocator_api</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</div></div><div class='docblock'><p>Attempts to extend the allocation referenced by <code>ptr</code> to fit <code>new_size</code>. <a href="../../std/alloc/trait.Alloc.html#method.grow_in_place">Read more</a></p>
</div><h4 id='method.shrink_in_place' class="method"><code id='shrink_in_place.v'>unsafe fn <a href='../../std/alloc/trait.Alloc.html#method.shrink_in_place' class='fnname'>shrink_in_place</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;ptr: <a class="struct" href="../../std/ptr/struct.NonNull.html" title="struct std::ptr::NonNull">NonNull</a>&lt;<a class="primitive" href="../primitive.u8.html">u8</a>&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;layout: <a class="struct" href="../../std/alloc/struct.Layout.html" title="struct std::alloc::Layout">Layout</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;new_size: <a class="primitive" href="../primitive.usize.html">usize</a><br>) -&gt; <a class="enum" href="../../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;<a class="primitive" href="../primitive.unit.html">()</a>, <a class="struct" href="../../std/alloc/struct.CannotReallocInPlace.html" title="struct std::alloc::CannotReallocInPlace">CannotReallocInPlace</a>&gt;</code><a class='srclink' href='../../src/core/alloc.rs.html#1018-1032' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>allocator_api</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</div></div><div class='docblock'><p>Attempts to shrink the allocation referenced by <code>ptr</code> to fit <code>new_size</code>. <a href="../../std/alloc/trait.Alloc.html#method.shrink_in_place">Read more</a></p>
</div><h4 id='method.alloc_one' class="method"><code id='alloc_one.v'>fn <a href='../../std/alloc/trait.Alloc.html#method.alloc_one' class='fnname'>alloc_one</a>&lt;T&gt;(&amp;mut self) -&gt; <a class="enum" href="../../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;<a class="struct" href="../../std/ptr/struct.NonNull.html" title="struct std::ptr::NonNull">NonNull</a>&lt;T&gt;, <a class="struct" href="../../std/alloc/struct.AllocErr.html" title="struct std::alloc::AllocErr">AllocErr</a>&gt;</code><a class='srclink' href='../../src/core/alloc.rs.html#1067-1076' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>allocator_api</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</div></div><div class='docblock'><p>Allocates a block suitable for holding an instance of <code>T</code>. <a href="../../std/alloc/trait.Alloc.html#method.alloc_one">Read more</a></p>
</div><h4 id='method.dealloc_one' class="method"><code id='dealloc_one.v'>unsafe fn <a href='../../std/alloc/trait.Alloc.html#method.dealloc_one' class='fnname'>dealloc_one</a>&lt;T&gt;(&amp;mut self, ptr: <a class="struct" href="../../std/ptr/struct.NonNull.html" title="struct std::ptr::NonNull">NonNull</a>&lt;T&gt;)</code><a class='srclink' href='../../src/core/alloc.rs.html#1095-1102' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>allocator_api</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</div></div><div class='docblock'><p>Deallocates a block suitable for holding an instance of <code>T</code>. <a href="../../std/alloc/trait.Alloc.html#method.dealloc_one">Read more</a></p>
</div><h4 id='method.alloc_array' class="method"><code id='alloc_array.v'>fn <a href='../../std/alloc/trait.Alloc.html#method.alloc_array' class='fnname'>alloc_array</a>&lt;T&gt;(&amp;mut self, n: <a class="primitive" href="../primitive.usize.html">usize</a>) -&gt; <a class="enum" href="../../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;<a class="struct" href="../../std/ptr/struct.NonNull.html" title="struct std::ptr::NonNull">NonNull</a>&lt;T&gt;, <a class="struct" href="../../std/alloc/struct.AllocErr.html" title="struct std::alloc::AllocErr">AllocErr</a>&gt;</code><a class='srclink' href='../../src/core/alloc.rs.html#1136-1147' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>allocator_api</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</div></div><div class='docblock'><p>Allocates a block suitable for holding <code>n</code> instances of <code>T</code>. <a href="../../std/alloc/trait.Alloc.html#method.alloc_array">Read more</a></p>
</div><h4 id='method.realloc_array' class="method"><code id='realloc_array.v'>unsafe fn <a href='../../std/alloc/trait.Alloc.html#method.realloc_array' class='fnname'>realloc_array</a>&lt;T&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;ptr: <a class="struct" href="../../std/ptr/struct.NonNull.html" title="struct std::ptr::NonNull">NonNull</a>&lt;T&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;n_old: <a class="primitive" href="../primitive.usize.html">usize</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;n_new: <a class="primitive" href="../primitive.usize.html">usize</a><br>) -&gt; <a class="enum" href="../../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;<a class="struct" href="../../std/ptr/struct.NonNull.html" title="struct std::ptr::NonNull">NonNull</a>&lt;T&gt;, <a class="struct" href="../../std/alloc/struct.AllocErr.html" title="struct std::alloc::AllocErr">AllocErr</a>&gt;</code><a class='srclink' href='../../src/core/alloc.rs.html#1183-1198' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>allocator_api</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</div></div><div class='docblock'><p>Reallocates a block previously suitable for holding <code>n_old</code> instances of <code>T</code>, returning a block suitable for holding <code>n_new</code> instances of <code>T</code>. <a href="../../std/alloc/trait.Alloc.html#method.realloc_array">Read more</a></p>
</div><h4 id='method.dealloc_array' class="method"><code id='dealloc_array.v'>unsafe fn <a href='../../std/alloc/trait.Alloc.html#method.dealloc_array' class='fnname'>dealloc_array</a>&lt;T&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;ptr: <a class="struct" href="../../std/ptr/struct.NonNull.html" title="struct std::ptr::NonNull">NonNull</a>&lt;T&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;n: <a class="primitive" href="../primitive.usize.html">usize</a><br>) -&gt; <a class="enum" href="../../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;<a class="primitive" href="../primitive.unit.html">()</a>, <a class="struct" href="../../std/alloc/struct.AllocErr.html" title="struct std::alloc::AllocErr">AllocErr</a>&gt;</code><a class='srclink' href='../../src/core/alloc.rs.html#1220-1231' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>allocator_api</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</div></div><div class='docblock'><p>Deallocates a block suitable for holding <code>n</code> instances of <code>T</code>. <a href="../../std/alloc/trait.Alloc.html#method.dealloc_array">Read more</a></p>
</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="../../std/marker/trait.Send.html" title="trait std::marker::Send">Send</a> for <a class="struct" href="../../std/alloc/struct.System.html" title="struct std::alloc::System">System</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="../../std/marker/trait.Sync.html" title="trait std::marker::Sync">Sync</a> for <a class="struct" href="../../std/alloc/struct.System.html" title="struct std::alloc::System">System</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-TryFrom' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="../../std/convert/trait.TryFrom.html" title="trait std::convert::TryFrom">TryFrom</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="../../std/convert/trait.Into.html" title="trait std::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryFrom' class='anchor'></a><a class='srclink' href='../../src/core/convert.rs.html#565-571' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='../../std/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="../../std/convert/enum.Infallible.html" title="enum std::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='../../std/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -&gt; <a class="enum" href="../../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="../../std/convert/trait.TryFrom.html" title="trait std::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="../../std/convert/trait.TryFrom.html#associatedtype.Error" title="type std::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='../../src/core/convert.rs.html#568-570' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-From' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="../../std/convert/trait.From.html" title="trait std::convert::From">From</a> for T</code><a href='#impl-From' class='anchor'></a><a class='srclink' href='../../src/core/convert.rs.html#546-548' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='../../std/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -&gt; T</code><a class='srclink' href='../../src/core/convert.rs.html#547' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryInto' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="../../std/convert/trait.TryInto.html" title="trait std::convert::TryInto">TryInto</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="../../std/convert/trait.TryFrom.html" title="trait std::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryInto' class='anchor'></a><a class='srclink' href='../../src/core/convert.rs.html#553-560' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='../../std/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = &lt;U as <a class="trait" href="../../std/convert/trait.TryFrom.html" title="trait std::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="../../std/convert/trait.TryFrom.html#associatedtype.Error" title="type std::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='../../std/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -&gt; <a class="enum" href="../../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="../../std/convert/trait.TryFrom.html" title="trait std::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="../../std/convert/trait.TryFrom.html#associatedtype.Error" title="type std::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='../../src/core/convert.rs.html#557-559' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Into' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="../../std/convert/trait.Into.html" title="trait std::convert::Into">Into</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="../../std/convert/trait.From.html" title="trait std::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-Into' class='anchor'></a><a class='srclink' href='../../src/core/convert.rs.html#537-542' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='../../std/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -&gt; U</code><a class='srclink' href='../../src/core/convert.rs.html#539-541' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Borrow' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="../../std/borrow/trait.Borrow.html" title="trait std::borrow::Borrow">Borrow</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Borrow' class='anchor'></a><a class='srclink' href='../../src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="primitive" href="../primitive.reference.html">&amp;'_ mut </a>F</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="primitive" href="../primitive.reference.html">&amp;'_ mut </a>F</h3><code class="content"><span class="where fmt-newline">impl&lt;'_, F&gt; <a class="trait" href="../../std/future/trait.Future.html" title="trait std::future::Future">Future</a> for <a class="primitive" href="../primitive.reference.html">&amp;'_ mut </a>F <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="../../std/marker/trait.Unpin.html" title="trait std::marker::Unpin">Unpin</a> + <a class="trait" href="../../std/future/trait.Future.html" title="trait std::future::Future">Future</a> + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></span><span class="where fmt-newline">    type <a href='../../std/future/trait.Future.html#associatedtype.Output' class="type">Output</a> = &lt;F as <a class="trait" href="../../std/future/trait.Future.html" title="trait std::future::Future">Future</a>&gt;::<a class="type" href="../../std/future/trait.Future.html#associatedtype.Output" title="type std::future::Future::Output">Output</a>;</span><span class="where fmt-newline">impl&lt;'_, I&gt; <a class="trait" href="../../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> for <a class="primitive" href="../primitive.reference.html">&amp;'_ mut </a>I <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="../../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></span><span class="where fmt-newline">    type <a href='../../std/iter/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = &lt;I as <a class="trait" href="../../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a>&gt;::<a class="type" href="../../std/iter/trait.Iterator.html#associatedtype.Item" title="type std::iter::Iterator::Item">Item</a>;</span><span class="where fmt-newline">impl&lt;R:&nbsp;<a class="trait" href="../../std/io/trait.Read.html" title="trait std::io::Read">Read</a> + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>, '_&gt; <a class="trait" href="../../std/io/trait.Read.html" title="trait std::io::Read">Read</a> for <a class="primitive" href="../primitive.reference.html">&amp;'_ mut </a>R</span><span class="where fmt-newline">impl&lt;W:&nbsp;<a class="trait" href="../../std/io/trait.Write.html" title="trait std::io::Write">Write</a> + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>, '_&gt; <a class="trait" href="../../std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="primitive" href="../primitive.reference.html">&amp;'_ mut </a>W</span></code></div></div><code id='borrow.v'>fn <a href='../../std/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&amp;self) -&gt; <a class="primitive" href="../primitive.reference.html">&amp;</a>T</code><a class='srclink' href='../../src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="../../std/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id='impl-BorrowMut' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="../../std/borrow/trait.BorrowMut.html" title="trait std::borrow::BorrowMut">BorrowMut</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-BorrowMut' class='anchor'></a><a class='srclink' href='../../src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="primitive" href="../primitive.reference.html">&amp;'_ mut </a>F</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="primitive" href="../primitive.reference.html">&amp;'_ mut </a>F</h3><code class="content"><span class="where fmt-newline">impl&lt;'_, F&gt; <a class="trait" href="../../std/future/trait.Future.html" title="trait std::future::Future">Future</a> for <a class="primitive" href="../primitive.reference.html">&amp;'_ mut </a>F <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="../../std/marker/trait.Unpin.html" title="trait std::marker::Unpin">Unpin</a> + <a class="trait" href="../../std/future/trait.Future.html" title="trait std::future::Future">Future</a> + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></span><span class="where fmt-newline">    type <a href='../../std/future/trait.Future.html#associatedtype.Output' class="type">Output</a> = &lt;F as <a class="trait" href="../../std/future/trait.Future.html" title="trait std::future::Future">Future</a>&gt;::<a class="type" href="../../std/future/trait.Future.html#associatedtype.Output" title="type std::future::Future::Output">Output</a>;</span><span class="where fmt-newline">impl&lt;'_, I&gt; <a class="trait" href="../../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> for <a class="primitive" href="../primitive.reference.html">&amp;'_ mut </a>I <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="../../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></span><span class="where fmt-newline">    type <a href='../../std/iter/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = &lt;I as <a class="trait" href="../../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a>&gt;::<a class="type" href="../../std/iter/trait.Iterator.html#associatedtype.Item" title="type std::iter::Iterator::Item">Item</a>;</span><span class="where fmt-newline">impl&lt;R:&nbsp;<a class="trait" href="../../std/io/trait.Read.html" title="trait std::io::Read">Read</a> + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>, '_&gt; <a class="trait" href="../../std/io/trait.Read.html" title="trait std::io::Read">Read</a> for <a class="primitive" href="../primitive.reference.html">&amp;'_ mut </a>R</span><span class="where fmt-newline">impl&lt;W:&nbsp;<a class="trait" href="../../std/io/trait.Write.html" title="trait std::io::Write">Write</a> + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>, '_&gt; <a class="trait" href="../../std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="primitive" href="../primitive.reference.html">&amp;'_ mut </a>W</span></code></div></div><code id='borrow_mut.v'>fn <a href='../../std/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="../primitive.reference.html">&amp;mut </a>T</code><a class='srclink' href='../../src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="../../std/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="../../std/any/trait.Any.html" title="trait std::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='../../src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='../../std/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&amp;self) -&gt; <a class="struct" href="../../std/any/struct.TypeId.html" title="struct std::any::TypeId">TypeId</a></code><a class='srclink' href='../../src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="../../std/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="../../std/borrow/trait.ToOwned.html" title="trait std::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/clone/trait.Clone.html" title="trait std::clone::Clone">Clone</a>,&nbsp;</span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='../../src/alloc/borrow.rs.html#80-91' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='../../std/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='../../std/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&amp;self) -&gt; T</code><a class='srclink' href='../../src/alloc/borrow.rs.html#84-86' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="../../std/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='../../std/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&amp;self, target: <a class="primitive" href="../primitive.reference.html">&amp;mut </a>T)</code><a class='srclink' href='../../src/alloc/borrow.rs.html#88-90' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/41263">#41263</a>)</summary><p>recently added</p>
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="../../std/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
</div></div></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><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 = "std";</script><script src="../../aliases.js"></script><script src="../../main1.35.0.js"></script><script defer src="../../search-index.js"></script></body></html>