Sophie

Sophie

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

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

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Layout` struct in crate `alloc`."><meta name="keywords" content="rust, rustlang, rust-lang, Layout"><title>alloc::alloc::Layout - 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='../../alloc/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='logo' width='100'></a><p class='location'>Struct Layout</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.from_size_align">from_size_align</a><a href="#method.from_size_align_unchecked">from_size_align_unchecked</a><a href="#method.size">size</a><a href="#method.align">align</a><a href="#method.new">new</a><a href="#method.for_value">for_value</a><a href="#method.align_to">align_to</a><a href="#method.padding_needed_for">padding_needed_for</a><a href="#method.repeat">repeat</a><a href="#method.extend">extend</a><a href="#method.repeat_packed">repeat_packed</a><a href="#method.extend_packed">extend_packed</a><a href="#method.array">array</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-PartialEq%3CLayout%3E">PartialEq&lt;Layout&gt;</a><a href="#impl-Debug">Debug</a><a href="#impl-Eq">Eq</a><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</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'>alloc</a>::<wbr><a href='index.html'>alloc</a></p><script>window.sidebarCurrent = {name: 'Layout', 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'>alloc</a>::<wbr><a href='index.html'>alloc</a>::<wbr><a class="struct" href=''>Layout</a></span><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/core/alloc.rs.html#51-63' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust struct'>pub struct Layout { /* fields omitted */ }</pre></div><div class='docblock'><p>Layout of a block of memory.</p>
<p>An instance of <code>Layout</code> describes a particular layout of memory.
You build a <code>Layout</code> up as an input to give to an allocator.</p>
<p>All layouts have an associated non-negative size and a
power-of-two alignment.</p>
<p>(Note however that layouts are <em>not</em> required to have positive
size, even though many allocators require that all memory
requests have positive size. A caller to the <code>Alloc::alloc</code>
method must either ensure that conditions like this are met, or
use specific allocators with looser requirements.)</p>
</div>
                    <h2 id='methods' class='small-section-header'>
                      Methods<a href='#methods' class='anchor'></a>
                    </h2>
                <h3 id='impl' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="struct" href="../../alloc/alloc/struct.Layout.html" title="struct alloc::alloc::Layout">Layout</a></code><a href='#impl' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#65-329' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.from_size_align' class="method"><span id='from_size_align.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.from_size_align' class='fnname'>from_size_align</a>(size: usize, align: usize) -&gt; <a class="enum" href="../../core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="../../alloc/alloc/struct.Layout.html" title="struct alloc::alloc::Layout">Layout</a>, <a class="struct" href="../../alloc/alloc/struct.LayoutErr.html" title="struct alloc::alloc::LayoutErr">LayoutErr</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#77-103' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Constructs a <code>Layout</code> from a given <code>size</code> and <code>align</code>,
or returns <code>LayoutErr</code> if either of the following conditions
are not met:</p>
<ul>
<li>
<p><code>align</code> must be a power of two,</p>
</li>
<li>
<p><code>size</code>, when rounded up to the nearest multiple of <code>align</code>,
must not overflow (i.e. the rounded value must be less than
<code>usize::MAX</code>).</p>
</li>
</ul>
</div><h4 id='method.from_size_align_unchecked' class="method"><span id='from_size_align_unchecked.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub unsafe fn <a href='#method.from_size_align_unchecked' class='fnname'>from_size_align_unchecked</a>(size: usize, align: usize) -&gt; <a class="struct" href="../../alloc/alloc/struct.Layout.html" title="struct alloc::alloc::Layout">Layout</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#113-115' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Creates a layout, bypassing all checks.</p>
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
<p>This function is unsafe as it does not verify the preconditions from
<a href="#method.from_size_align"><code>Layout::from_size_align</code></a>.</p>
</div><h4 id='method.size' class="method"><span id='size.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.size' class='fnname'>size</a>(&amp;self) -&gt; usize</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#120' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>The minimum size in bytes for a memory block of this layout.</p>
</div><h4 id='method.align' class="method"><span id='align.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.align' class='fnname'>align</a>(&amp;self) -&gt; usize</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#125' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>The minimum byte alignment for a memory block of this layout.</p>
</div><h4 id='method.new' class="method"><span id='new.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.new' class='fnname'>new</a>&lt;T&gt;() -&gt; <a class="struct" href="../../alloc/alloc/struct.Layout.html" title="struct alloc::alloc::Layout">Layout</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#130-140' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Constructs a <code>Layout</code> suitable for holding a value of type <code>T</code>.</p>
</div><h4 id='method.for_value' class="method"><span id='for_value.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.for_value' class='fnname'>for_value</a>&lt;T&gt;(t: &amp;T) -&gt; <a class="struct" href="../../alloc/alloc/struct.Layout.html" title="struct alloc::alloc::Layout">Layout</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#147-154' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Produces layout describing a record that could be used to
allocate backing structure for <code>T</code> (which could be a trait
or other unsized type like a slice).</p>
</div><h4 id='method.align_to' class="method"><span id='align_to.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.align_to' class='fnname'>align_to</a>(&amp;self, align: usize) -&gt; <a class="struct" href="../../alloc/alloc/struct.Layout.html" title="struct alloc::alloc::Layout">Layout</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#175-177' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><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><div class='docblock'><p>Creates a layout describing the record that can hold a value
of the same layout as <code>self</code>, but that also is aligned to
alignment <code>align</code> (measured in bytes).</p>
<p>If <code>self</code> already meets the prescribed alignment, then returns
<code>self</code>.</p>
<p>Note that this method does not add any padding to the overall
size, regardless of whether the returned layout has a different
alignment. In other words, if <code>K</code> has size 16, <code>K.align_to(32)</code>
will <em>still</em> have size 16.</p>
<h1 id="panics" class="section-header"><a href="#panics">Panics</a></h1>
<p>Panics if the combination of <code>self.size()</code> and the given <code>align</code>
violates the conditions listed in
<a href="#method.from_size_align"><code>Layout::from_size_align</code></a>.</p>
</div><h4 id='method.padding_needed_for' class="method"><span id='padding_needed_for.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.padding_needed_for' class='fnname'>padding_needed_for</a>(&amp;self, align: usize) -&gt; usize</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#197-222' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><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><div class='docblock'><p>Returns the amount of padding we must insert after <code>self</code>
to ensure that the following address will satisfy <code>align</code>
(measured in bytes).</p>
<p>E.g. if <code>self.size()</code> is 9, then <code>self.padding_needed_for(4)</code>
returns 3, because that is the minimum number of bytes of
padding required to get a 4-aligned address (assuming that the
corresponding memory block starts at a 4-aligned address).</p>
<p>The return value of this function has no meaning if <code>align</code> is
not a power-of-two.</p>
<p>Note that the utility of the returned value requires <code>align</code>
to be less than or equal to the alignment of the starting
address for the whole allocated block of memory. One way to
satisfy this constraint is to ensure <code>align &lt;= self.align()</code>.</p>
</div><h4 id='method.repeat' class="method"><span id='repeat.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.repeat' class='fnname'>repeat</a>(&amp;self, n: usize) -&gt; <a class="enum" href="../../core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;(<a class="struct" href="../../alloc/alloc/struct.Layout.html" title="struct alloc::alloc::Layout">Layout</a>, usize), <a class="struct" href="../../alloc/alloc/struct.LayoutErr.html" title="struct alloc::alloc::LayoutErr">LayoutErr</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#234-245' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><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><div class='docblock'><p>Creates a layout describing the record for <code>n</code> instances of
<code>self</code>, with a suitable amount of padding between each to
ensure that each instance is given its requested size and
alignment. On success, returns <code>(k, offs)</code> where <code>k</code> is the
layout of the array and <code>offs</code> is the distance between the start
of each element in the array.</p>
<p>On arithmetic overflow, returns <code>LayoutErr</code>.</p>
</div><h4 id='method.extend' class="method"><span id='extend.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.extend' class='fnname'>extend</a>(&amp;self, next: <a class="struct" href="../../alloc/alloc/struct.Layout.html" title="struct alloc::alloc::Layout">Layout</a>) -&gt; <a class="enum" href="../../core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;(<a class="struct" href="../../alloc/alloc/struct.Layout.html" title="struct alloc::alloc::Layout">Layout</a>, usize), <a class="struct" href="../../alloc/alloc/struct.LayoutErr.html" title="struct alloc::alloc::LayoutErr">LayoutErr</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#260-271' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><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><div class='docblock'><p>Creates a layout describing the record for <code>self</code> followed by
<code>next</code>, including any necessary padding to ensure that <code>next</code>
will be properly aligned. Note that the result layout will
satisfy the alignment properties of both <code>self</code> and <code>next</code>.</p>
<p>Returns <code>Some((k, offset))</code>, where <code>k</code> is layout of the concatenated
record and <code>offset</code> is the relative location, in bytes, of the
start of the <code>next</code> embedded within the concatenated record
(assuming that the record itself starts at offset 0).</p>
<p>On arithmetic overflow, returns <code>LayoutErr</code>.</p>
</div><h4 id='method.repeat_packed' class="method"><span id='repeat_packed.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.repeat_packed' class='fnname'>repeat_packed</a>(&amp;self, n: usize) -&gt; <a class="enum" href="../../core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="../../alloc/alloc/struct.Layout.html" title="struct alloc::alloc::Layout">Layout</a>, <a class="struct" href="../../alloc/alloc/struct.LayoutErr.html" title="struct alloc::alloc::LayoutErr">LayoutErr</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#287-290' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><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><div class='docblock'><p>Creates a layout describing the record for <code>n</code> instances of
<code>self</code>, with no padding between each instance.</p>
<p>Note that, unlike <code>repeat</code>, <code>repeat_packed</code> does not guarantee
that the repeated instances of <code>self</code> will be properly
aligned, even if a given instance of <code>self</code> is properly
aligned. In other words, if the layout returned by
<code>repeat_packed</code> is used to allocate an array, it is not
guaranteed that all elements in the array will be properly
aligned.</p>
<p>On arithmetic overflow, returns <code>LayoutErr</code>.</p>
</div><h4 id='method.extend_packed' class="method"><span id='extend_packed.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.extend_packed' class='fnname'>extend_packed</a>(&amp;self, next: <a class="struct" href="../../alloc/alloc/struct.Layout.html" title="struct alloc::alloc::Layout">Layout</a>) -&gt; <a class="enum" href="../../core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;(<a class="struct" href="../../alloc/alloc/struct.Layout.html" title="struct alloc::alloc::Layout">Layout</a>, usize), <a class="struct" href="../../alloc/alloc/struct.LayoutErr.html" title="struct alloc::alloc::LayoutErr">LayoutErr</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#309-314' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><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><div class='docblock'><p>Creates a layout describing the record for <code>self</code> followed by
<code>next</code> with no additional padding between the two. Since no
padding is inserted, the alignment of <code>next</code> is irrelevant,
and is not incorporated <em>at all</em> into the resulting layout.</p>
<p>Returns <code>(k, offset)</code>, where <code>k</code> is layout of the concatenated
record and <code>offset</code> is the relative location, in bytes, of the
start of the <code>next</code> embedded within the concatenated record
(assuming that the record itself starts at offset 0).</p>
<p>(The <code>offset</code> is always the same as <code>self.size()</code>; we use this
signature out of convenience in matching the signature of
<code>extend</code>.)</p>
<p>On arithmetic overflow, returns <code>LayoutErr</code>.</p>
</div><h4 id='method.array' class="method"><span id='array.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.array' class='fnname'>array</a>&lt;T&gt;(n: usize) -&gt; <a class="enum" href="../../core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="../../alloc/alloc/struct.Layout.html" title="struct alloc::alloc::Layout">Layout</a>, <a class="struct" href="../../alloc/alloc/struct.LayoutErr.html" title="struct alloc::alloc::LayoutErr">LayoutErr</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#321-328' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><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><div class='docblock'><p>Creates a layout describing the record for a <code>[T; n]</code>.</p>
<p>On arithmetic overflow, returns <code>LayoutErr</code>.</p>
</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-PartialEq%3CLayout%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>&lt;<a class="struct" href="../../alloc/alloc/struct.Layout.html" title="struct alloc::alloc::Layout">Layout</a>&gt; for <a class="struct" href="../../alloc/alloc/struct.Layout.html" title="struct alloc::alloc::Layout">Layout</a></code><a href='#impl-PartialEq%3CLayout%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#50' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.eq' class="method"><span id='eq.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, other: &amp;<a class="struct" href="../../alloc/alloc/struct.Layout.html" title="struct alloc::alloc::Layout">Layout</a>) -&gt; bool</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#50' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="../../core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id='method.ne' class="method"><span id='ne.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, other: &amp;<a class="struct" href="../../alloc/alloc/struct.Layout.html" title="struct alloc::alloc::Layout">Layout</a>) -&gt; bool</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#50' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id='impl-Debug' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../alloc/fmt/trait.Debug.html" title="trait alloc::fmt::Debug">Debug</a> for <a class="struct" href="../../alloc/alloc/struct.Layout.html" title="struct alloc::alloc::Layout">Layout</a></code><a href='#impl-Debug' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#50' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../alloc/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="../../alloc/fmt/struct.Formatter.html" title="struct alloc::fmt::Formatter">Formatter</a>) -&gt; <a class="enum" href="../../core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;(), <a class="struct" href="../../alloc/fmt/struct.Error.html" title="struct alloc::fmt::Error">Error</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#50' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Formats the value using the given formatter. <a href="../../alloc/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id='impl-Eq' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="../../alloc/alloc/struct.Layout.html" title="struct alloc::alloc::Layout">Layout</a></code><a href='#impl-Eq' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#50' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-Clone' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../alloc/alloc/struct.Layout.html" title="struct alloc::alloc::Layout">Layout</a></code><a href='#impl-Clone' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#50' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.clone' class="method"><span id='clone.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class="struct" href="../../alloc/alloc/struct.Layout.html" title="struct alloc::alloc::Layout">Layout</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#50' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns a copy of the value. <a href="../../core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id='method.clone_from' class="method"><span id='clone_from.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: &amp;Self)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='../../src/core/clone.rs.html#130-132' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="../../core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 id='impl-Copy' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="struct" href="../../alloc/alloc/struct.Layout.html" title="struct alloc::alloc::Layout">Layout</a></code><a href='#impl-Copy' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/alloc.rs.html#50' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'></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="../../core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../alloc/alloc/struct.Layout.html" title="struct alloc::alloc::Layout">Layout</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="../../core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../alloc/alloc/struct.Layout.html" title="struct alloc::alloc::Layout">Layout</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 = "alloc";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>