Sophie

Sophie

distrib > Mageia > 6 > x86_64 > media > core-updates > by-pkgid > e50df336eb49b92dbadf6dedc48b7934 > files > 11734

rust-doc-1.27.0-1.mga6.x86_64.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="../../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 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='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.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-GlobalAlloc">GlobalAlloc</a><a href="#impl-Alloc">Alloc</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></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="../../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'>Struct <a href='../index.html'>std</a>::<wbr><a href='index.html'>alloc</a>::<wbr><a class="struct" href=''>System</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></span></h1><div class="docblock type-decl"><pre class='rust struct'>pub struct System;</pre></div><div class='stability'><div class='stab unstable'><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>allocator_api </code><a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</div></div>
                <h2 id='implementations' class='small-section-header'>
                  Trait Implementations<a href='#implementations' class='anchor'></a>
                </h2>
                <div id='implementations-list'><h3 id='impl-GlobalAlloc' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../core/alloc/trait.GlobalAlloc.html" title="trait core::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></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.alloc' class="method"><span id='alloc.v' class='invisible'><table class='table-display'><tbody><tr><td><code>unsafe fn <a href='../../core/alloc/trait.GlobalAlloc.html#tymethod.alloc' class='fnname'>alloc</a>(&amp;self, layout: <a class="struct" href="../../core/alloc/struct.Layout.html" title="struct core::alloc::Layout">Layout</a>) -&gt; <a class="primitive" href="../primitive.pointer.html">*mut </a><a class="foreigntype" href="../../core/alloc/foreigntype.Opaque.html" title="foreigntype core::alloc::Opaque">Opaque</a></code></td><td></td></tr></tbody></table></span></h4><div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>allocator_api </code><a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</summary><p>the precise API and guarantees it provides may be tweaked slightly, especially to possibly take into account the types being stored to make room for a future tracing garbage collector</p>
</details></div></div><div class='docblock'><p>Allocate memory as described by the given <code>layout</code>. <a href="../../core/alloc/trait.GlobalAlloc.html#tymethod.alloc">Read more</a></p>
</div><h4 id='method.alloc_zeroed' class="method"><span id='alloc_zeroed.v' class='invisible'><table class='table-display'><tbody><tr><td><code>unsafe fn <a href='../../core/alloc/trait.GlobalAlloc.html#method.alloc_zeroed' class='fnname'>alloc_zeroed</a>(&amp;self, layout: <a class="struct" href="../../core/alloc/struct.Layout.html" title="struct core::alloc::Layout">Layout</a>) -&gt; <a class="primitive" href="../primitive.pointer.html">*mut </a><a class="foreigntype" href="../../core/alloc/foreigntype.Opaque.html" title="foreigntype core::alloc::Opaque">Opaque</a></code></td><td></td></tr></tbody></table></span></h4><div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>allocator_api </code><a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</summary><p>the precise API and guarantees it provides may be tweaked slightly, especially to possibly take into account the types being stored to make room for a future tracing garbage collector</p>
</details></div></div><h4 id='method.dealloc' class="method"><span id='dealloc.v' class='invisible'><table class='table-display'><tbody><tr><td><code>unsafe fn <a href='../../core/alloc/trait.GlobalAlloc.html#tymethod.dealloc' class='fnname'>dealloc</a>(&amp;self, ptr: <a class="primitive" href="../primitive.pointer.html">*mut </a><a class="foreigntype" href="../../core/alloc/foreigntype.Opaque.html" title="foreigntype core::alloc::Opaque">Opaque</a>, _layout: <a class="struct" href="../../core/alloc/struct.Layout.html" title="struct core::alloc::Layout">Layout</a>)</code></td><td></td></tr></tbody></table></span></h4><div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>allocator_api </code><a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</summary><p>the precise API and guarantees it provides may be tweaked slightly, especially to possibly take into account the types being stored to make room for a future tracing garbage collector</p>
</details></div></div><div class='docblock'><p>Deallocate the block of memory at the given <code>ptr</code> pointer with the given <code>layout</code>. <a href="../../core/alloc/trait.GlobalAlloc.html#tymethod.dealloc">Read more</a></p>
</div><h4 id='method.realloc' class="method"><span id='realloc.v' class='invisible'><table class='table-display'><tbody><tr><td><code>unsafe fn <a href='../../core/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="foreigntype" href="../../core/alloc/foreigntype.Opaque.html" title="foreigntype core::alloc::Opaque">Opaque</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;layout: <a class="struct" href="../../core/alloc/struct.Layout.html" title="struct core::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="foreigntype" href="../../core/alloc/foreigntype.Opaque.html" title="foreigntype core::alloc::Opaque">Opaque</a></code></td><td></td></tr></tbody></table></span></h4><div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>allocator_api </code><a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</summary><p>the precise API and guarantees it provides may be tweaked slightly, especially to possibly take into account the types being stored to make room for a future tracing garbage collector</p>
</details></div></div><div class='docblock'><p>Shink 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="../../core/alloc/trait.GlobalAlloc.html#method.realloc">Read more</a></p>
</div></div><h3 id='impl-Alloc' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../core/alloc/trait.Alloc.html" title="trait core::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></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.alloc-1' class="method"><span id='alloc.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>unsafe fn <a href='../../core/alloc/trait.Alloc.html#tymethod.alloc' class='fnname'>alloc</a>(&amp;mut self, layout: <a class="struct" href="../../core/alloc/struct.Layout.html" title="struct core::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="foreigntype" href="../../core/alloc/foreigntype.Opaque.html" title="foreigntype core::alloc::Opaque">Opaque</a>&gt;, <a class="struct" href="../../core/alloc/struct.AllocErr.html" title="struct core::alloc::AllocErr">AllocErr</a>&gt;</code></td><td></td></tr></tbody></table></span></h4><div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>allocator_api </code><a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</summary><p>the precise API and guarantees it provides may be tweaked slightly, especially to possibly take into account the types being stored to make room for a future tracing garbage collector</p>
</details></div></div><div class='docblock'><p>Returns a pointer meeting the size and alignment guarantees of <code>layout</code>. <a href="../../core/alloc/trait.Alloc.html#tymethod.alloc">Read more</a></p>
</div><h4 id='method.alloc_zeroed-1' class="method"><span id='alloc_zeroed.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>unsafe fn <a href='../../core/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="../../core/alloc/struct.Layout.html" title="struct core::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="foreigntype" href="../../core/alloc/foreigntype.Opaque.html" title="foreigntype core::alloc::Opaque">Opaque</a>&gt;, <a class="struct" href="../../core/alloc/struct.AllocErr.html" title="struct core::alloc::AllocErr">AllocErr</a>&gt;</code></td><td></td></tr></tbody></table></span></h4><div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>allocator_api </code><a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</summary><p>the precise API and guarantees it provides may be tweaked slightly, especially to possibly take into account the types being stored to make room for a future tracing garbage collector</p>
</details></div></div><div class='docblock'><p>Behaves like <code>alloc</code>, but also ensures that the contents are set to zero before being returned. <a href="../../core/alloc/trait.Alloc.html#method.alloc_zeroed">Read more</a></p>
</div><h4 id='method.dealloc-1' class="method"><span id='dealloc.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>unsafe fn <a href='../../core/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="foreigntype" href="../../core/alloc/foreigntype.Opaque.html" title="foreigntype core::alloc::Opaque">Opaque</a>&gt;, layout: <a class="struct" href="../../core/alloc/struct.Layout.html" title="struct core::alloc::Layout">Layout</a>)</code></td><td></td></tr></tbody></table></span></h4><div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>allocator_api </code><a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</summary><p>the precise API and guarantees it provides may be tweaked slightly, especially to possibly take into account the types being stored to make room for a future tracing garbage collector</p>
</details></div></div><div class='docblock'><p>Deallocate the memory referenced by <code>ptr</code>. <a href="../../core/alloc/trait.Alloc.html#tymethod.dealloc">Read more</a></p>
</div><h4 id='method.realloc-1' class="method"><span id='realloc.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>unsafe fn <a href='../../core/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="foreigntype" href="../../core/alloc/foreigntype.Opaque.html" title="foreigntype core::alloc::Opaque">Opaque</a>&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;layout: <a class="struct" href="../../core/alloc/struct.Layout.html" title="struct core::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="foreigntype" href="../../core/alloc/foreigntype.Opaque.html" title="foreigntype core::alloc::Opaque">Opaque</a>&gt;, <a class="struct" href="../../core/alloc/struct.AllocErr.html" title="struct core::alloc::AllocErr">AllocErr</a>&gt;</code></td><td></td></tr></tbody></table></span></h4><div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>allocator_api </code><a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</summary><p>the precise API and guarantees it provides may be tweaked slightly, especially to possibly take into account the types being stored to make room for a future tracing garbage collector</p>
</details></div></div><div class='docblock'><p>Returns a pointer suitable for holding data described by a new layout with <code>layout</code>’s alginment 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="../../core/alloc/trait.Alloc.html#method.realloc">Read more</a></p>
</div><h4 id='method.usable_size' class="method"><span id='usable_size.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../core/alloc/trait.Alloc.html#method.usable_size' class='fnname'>usable_size</a>(&amp;self, layout: &amp;<a class="struct" href="../../core/alloc/struct.Layout.html" title="struct core::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></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#636-638' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>allocator_api </code><a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</summary><p>the precise API and guarantees it provides may be tweaked slightly, especially to possibly take into account the types being stored to make room for a future tracing garbage collector</p>
</details></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="../../core/alloc/trait.Alloc.html#method.usable_size">Read more</a></p>
</div><h4 id='method.alloc_excess' class="method"><span id='alloc_excess.v' class='invisible'><table class='table-display'><tbody><tr><td><code>unsafe fn <a href='../../core/alloc/trait.Alloc.html#method.alloc_excess' class='fnname'>alloc_excess</a>(&amp;mut self, layout: <a class="struct" href="../../core/alloc/struct.Layout.html" title="struct core::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="../../core/alloc/struct.Excess.html" title="struct core::alloc::Excess">Excess</a>, <a class="struct" href="../../core/alloc/struct.AllocErr.html" title="struct core::alloc::AllocErr">AllocErr</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#765-768' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>allocator_api </code><a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</summary><p>the precise API and guarantees it provides may be tweaked slightly, especially to possibly take into account the types being stored to make room for a future tracing garbage collector</p>
</details></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="../../core/alloc/trait.Alloc.html#method.alloc_excess">Read more</a></p>
</div><h4 id='method.realloc_excess' class="method"><span id='realloc_excess.v' class='invisible'><table class='table-display'><tbody><tr><td><code>unsafe fn <a href='../../core/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="foreigntype" href="../../core/alloc/foreigntype.Opaque.html" title="foreigntype core::alloc::Opaque">Opaque</a>&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;layout: <a class="struct" href="../../core/alloc/struct.Layout.html" title="struct core::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="../../core/alloc/struct.Excess.html" title="struct core::alloc::Excess">Excess</a>, <a class="struct" href="../../core/alloc/struct.AllocErr.html" title="struct core::alloc::AllocErr">AllocErr</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#787-795' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>allocator_api </code><a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</summary><p>the precise API and guarantees it provides may be tweaked slightly, especially to possibly take into account the types being stored to make room for a future tracing garbage collector</p>
</details></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="../../core/alloc/trait.Alloc.html#method.realloc_excess">Read more</a></p>
</div><h4 id='method.grow_in_place' class="method"><span id='grow_in_place.v' class='invisible'><table class='table-display'><tbody><tr><td><code>unsafe fn <a href='../../core/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="foreigntype" href="../../core/alloc/foreigntype.Opaque.html" title="foreigntype core::alloc::Opaque">Opaque</a>&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;layout: <a class="struct" href="../../core/alloc/struct.Layout.html" title="struct core::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="../../core/alloc/struct.CannotReallocInPlace.html" title="struct core::alloc::CannotReallocInPlace">CannotReallocInPlace</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#832-846' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>allocator_api </code><a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</summary><p>the precise API and guarantees it provides may be tweaked slightly, especially to possibly take into account the types being stored to make room for a future tracing garbage collector</p>
</details></div></div><div class='docblock'><p>Attempts to extend the allocation referenced by <code>ptr</code> to fit <code>new_size</code>. <a href="../../core/alloc/trait.Alloc.html#method.grow_in_place">Read more</a></p>
</div><h4 id='method.shrink_in_place' class="method"><span id='shrink_in_place.v' class='invisible'><table class='table-display'><tbody><tr><td><code>unsafe fn <a href='../../core/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="foreigntype" href="../../core/alloc/foreigntype.Opaque.html" title="foreigntype core::alloc::Opaque">Opaque</a>&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;layout: <a class="struct" href="../../core/alloc/struct.Layout.html" title="struct core::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="../../core/alloc/struct.CannotReallocInPlace.html" title="struct core::alloc::CannotReallocInPlace">CannotReallocInPlace</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#887-901' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>allocator_api </code><a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</summary><p>the precise API and guarantees it provides may be tweaked slightly, especially to possibly take into account the types being stored to make room for a future tracing garbage collector</p>
</details></div></div><div class='docblock'><p>Attempts to shrink the allocation referenced by <code>ptr</code> to fit <code>new_size</code>. <a href="../../core/alloc/trait.Alloc.html#method.shrink_in_place">Read more</a></p>
</div><h4 id='method.alloc_one' class="method"><span id='alloc_one.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../core/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="../../core/alloc/struct.AllocErr.html" title="struct core::alloc::AllocErr">AllocErr</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#934-943' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>allocator_api </code><a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</summary><p>the precise API and guarantees it provides may be tweaked slightly, especially to possibly take into account the types being stored to make room for a future tracing garbage collector</p>
</details></div></div><div class='docblock'><p>Allocates a block suitable for holding an instance of <code>T</code>. <a href="../../core/alloc/trait.Alloc.html#method.alloc_one">Read more</a></p>
</div><h4 id='method.dealloc_one' class="method"><span id='dealloc_one.v' class='invisible'><table class='table-display'><tbody><tr><td><code>unsafe fn <a href='../../core/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></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#962-969' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>allocator_api </code><a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</summary><p>the precise API and guarantees it provides may be tweaked slightly, especially to possibly take into account the types being stored to make room for a future tracing garbage collector</p>
</details></div></div><div class='docblock'><p>Deallocates a block suitable for holding an instance of <code>T</code>. <a href="../../core/alloc/trait.Alloc.html#method.dealloc_one">Read more</a></p>
</div><h4 id='method.alloc_array' class="method"><span id='alloc_array.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../core/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="../../core/alloc/struct.AllocErr.html" title="struct core::alloc::AllocErr">AllocErr</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#1001-1012' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>allocator_api </code><a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</summary><p>the precise API and guarantees it provides may be tweaked slightly, especially to possibly take into account the types being stored to make room for a future tracing garbage collector</p>
</details></div></div><div class='docblock'><p>Allocates a block suitable for holding <code>n</code> instances of <code>T</code>. <a href="../../core/alloc/trait.Alloc.html#method.alloc_array">Read more</a></p>
</div><h4 id='method.realloc_array' class="method"><span id='realloc_array.v' class='invisible'><table class='table-display'><tbody><tr><td><code>unsafe fn <a href='../../core/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="../../core/alloc/struct.AllocErr.html" title="struct core::alloc::AllocErr">AllocErr</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#1046-1061' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>allocator_api </code><a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</summary><p>the precise API and guarantees it provides may be tweaked slightly, especially to possibly take into account the types being stored to make room for a future tracing garbage collector</p>
</details></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="../../core/alloc/trait.Alloc.html#method.realloc_array">Read more</a></p>
</div><h4 id='method.dealloc_array' class="method"><span id='dealloc_array.v' class='invisible'><table class='table-display'><tbody><tr><td><code>unsafe fn <a href='../../core/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="../../core/alloc/struct.AllocErr.html" title="struct core::alloc::AllocErr">AllocErr</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#1083-1094' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>allocator_api </code><a href="https://github.com/rust-lang/rust/issues/32838">#32838</a>)</summary><p>the precise API and guarantees it provides may be tweaked slightly, especially to possibly take into account the types being stored to make room for a future tracing garbage collector</p>
</details></div></div><div class='docblock'><p>Deallocates a block suitable for holding <code>n</code> instances of <code>T</code>. <a href="../../core/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'><span class='in-band'><table class='table-display'><tbody><tr><td><code>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></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>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></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></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="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>