<!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 `PinBox` struct in crate `alloc`."><meta name="keywords" content="rust, rustlang, rust-lang, PinBox"><title>alloc::boxed::PinBox - 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">☰</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 PinBox</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.new">new</a><a href="#method.as_pin_mut">as_pin_mut</a><a href="#method.from_raw">from_raw</a><a href="#method.into_raw">into_raw</a><a href="#method.get_mut">get_mut</a><a href="#method.unpin">unpin</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-From%3CBox%3CT%3E%3E">From<Box<T>></a><a href="#impl-From%3CPinBox%3CT%3E%3E">From<PinBox<T>></a><a href="#impl-Deref">Deref</a><a href="#impl-DerefMut">DerefMut</a><a href="#impl-Display">Display</a><a href="#impl-Debug">Debug</a><a href="#impl-Pointer">Pointer</a><a href="#impl-CoerceUnsized%3CPinBox%3CU%3E%3E">CoerceUnsized<PinBox<U>></a><a href="#impl-Unpin">Unpin</a><a href="#impl-Future">Future</a><a href="#impl-UnsafeTask">UnsafeTask</a><a href="#impl-From%3CPinBox%3CF%3E%3E">From<PinBox<F>></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'>boxed</a></p><script>window.sidebarCurrent = {name: 'PinBox', 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'>boxed</a>::<wbr><a class="struct" href=''>PinBox</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'>−</span>]</a></span><a class='srclink' href='../../src/alloc/boxed.rs.html#761-763' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust struct'><div class="docblock attributes">#[repr(transparent)] </div>pub struct PinBox<T: ?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> { /* fields omitted */ }</pre></div><div class='stability'><div class='stab unstable'><span class=microscope>🔬</span> This is a nightly-only experimental API. (<code>pin </code><a href="https://github.com/rust-lang/rust/issues/49150">#49150</a>)</div></div><div class='docblock'><p>A pinned, heap allocated reference.</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<T> <a class="struct" href="../../alloc/boxed/struct.PinBox.html" title="struct alloc::boxed::PinBox">PinBox</a><T></code><a href='#impl' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/boxed.rs.html#766-772' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><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>(data: T) -> <a class="struct" href="../../alloc/boxed/struct.PinBox.html" title="struct alloc::boxed::PinBox">PinBox</a><T></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/boxed.rs.html#769-771' 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>pin </code><a href="https://github.com/rust-lang/rust/issues/49150">#49150</a>)</div></div><div class='docblock'><p>Allocate memory on the heap, move the data into it and pin it.</p> </div></div><h3 id='impl-1' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<T: ?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> <a class="struct" href="../../alloc/boxed/struct.PinBox.html" title="struct alloc::boxed::PinBox">PinBox</a><T></code><a href='#impl-1' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/boxed.rs.html#775-855' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.as_pin_mut' class="method"><span id='as_pin_mut.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.as_pin_mut' class='fnname'>as_pin_mut</a><'a>(&'a mut self) -> <a class="struct" href="../../core/mem/struct.PinMut.html" title="struct core::mem::PinMut">PinMut</a><'a, T></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/boxed.rs.html#778-780' 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>pin </code><a href="https://github.com/rust-lang/rust/issues/49150">#49150</a>)</div></div><div class='docblock'><p>Get a pinned reference to the data in this PinBox.</p> </div><h4 id='method.from_raw' class="method"><span id='from_raw.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub unsafe fn <a href='#method.from_raw' class='fnname'>from_raw</a>(raw: *mut T) -> Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/boxed.rs.html#807-809' 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>pin </code><a href="https://github.com/rust-lang/rust/issues/49150">#49150</a>)</div></div><div class='docblock'><p>Constructs a <code>PinBox</code> from a raw pointer.</p> <p>After calling this function, the raw pointer is owned by the resulting <code>PinBox</code>. Specifically, the <code>PinBox</code> destructor will call the destructor of <code>T</code> and free the allocated memory. Since the way <code>PinBox</code> allocates and releases memory is unspecified, the only valid pointer to pass to this function is the one taken from another <code>PinBox</code> via the <a href="struct.PinBox.html#method.into_raw"><code>PinBox::into_raw</code></a> function.</p> <p>This function is unsafe because improper use may lead to memory problems. For example, a double-free may occur if the function is called twice on the same raw pointer.</p> <h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1> <pre class="rust rust-example-rendered"> <span class="attribute">#![<span class="ident">feature</span>(<span class="ident">pin</span>)]</span> <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">boxed</span>::<span class="ident">PinBox</span>; <span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="ident">PinBox</span>::<span class="ident">new</span>(<span class="number">5</span>); <span class="kw">let</span> <span class="ident">ptr</span> <span class="op">=</span> <span class="ident">PinBox</span>::<span class="ident">into_raw</span>(<span class="ident">x</span>); <span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="kw">unsafe</span> { <span class="ident">PinBox</span>::<span class="ident">from_raw</span>(<span class="ident">ptr</span>) };</pre> </div><h4 id='method.into_raw' class="method"><span id='into_raw.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.into_raw' class='fnname'>into_raw</a>(b: <a class="struct" href="../../alloc/boxed/struct.PinBox.html" title="struct alloc::boxed::PinBox">PinBox</a><T>) -> *mut T</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/boxed.rs.html#834-836' 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>pin </code><a href="https://github.com/rust-lang/rust/issues/49150">#49150</a>)</div></div><div class='docblock'><p>Consumes the <code>PinBox</code>, returning the wrapped raw pointer.</p> <p>After calling this function, the caller is responsible for the memory previously managed by the <code>PinBox</code>. In particular, the caller should properly destroy <code>T</code> and release the memory. The proper way to do so is to convert the raw pointer back into a <code>PinBox</code> with the <a href="struct.PinBox.html#method.from_raw"><code>PinBox::from_raw</code></a> function.</p> <p>Note: this is an associated function, which means that you have to call it as <code>PinBox::into_raw(b)</code> instead of <code>b.into_raw()</code>. This is so that there is no conflict with a method on the inner type.</p> <h1 id="examples-1" class="section-header"><a href="#examples-1">Examples</a></h1> <pre class="rust rust-example-rendered"> <span class="attribute">#![<span class="ident">feature</span>(<span class="ident">pin</span>)]</span> <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">boxed</span>::<span class="ident">PinBox</span>; <span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="ident">PinBox</span>::<span class="ident">new</span>(<span class="number">5</span>); <span class="kw">let</span> <span class="ident">ptr</span> <span class="op">=</span> <span class="ident">PinBox</span>::<span class="ident">into_raw</span>(<span class="ident">x</span>);</pre> </div><h4 id='method.get_mut' class="method"><span id='get_mut.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub unsafe fn <a href='#method.get_mut' class='fnname'>get_mut</a><'a>(this: &'a mut <a class="struct" href="../../alloc/boxed/struct.PinBox.html" title="struct alloc::boxed::PinBox">PinBox</a><T>) -> &'a mut T</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/boxed.rs.html#843-845' 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>pin </code><a href="https://github.com/rust-lang/rust/issues/49150">#49150</a>)</div></div><div class='docblock'><p>Get a mutable reference to the data inside this PinBox.</p> <p>This function is unsafe. Users must guarantee that the data is never moved out of this reference.</p> </div><h4 id='method.unpin' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../../alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><I></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../../alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><I></h3><code class="content"><span class="where fmt-newline">impl<I: <a class="trait" href="../../core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> + ?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> <a class="trait" href="../../core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> for <a class="struct" href="../../alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><I></span><span class="where fmt-newline"> type <a href='../../core/iter/iterator/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = I::<a class="type" href="../../core/iter/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::iterator::Iterator::Item">Item</a>;</span></code></div></div><span id='unpin.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub unsafe fn <a href='#method.unpin' class='fnname'>unpin</a>(this: <a class="struct" href="../../alloc/boxed/struct.PinBox.html" title="struct alloc::boxed::PinBox">PinBox</a><T>) -> <a class="struct" href="../../alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><T></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/boxed.rs.html#852-854' 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>pin </code><a href="https://github.com/rust-lang/rust/issues/49150">#49150</a>)</div></div><div class='docblock'><p>Convert this PinBox into an unpinned Box.</p> <p>This function is unsafe. Users must guarantee that the data is never moved out of the box.</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-From%3CBox%3CT%3E%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<T: ?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> <a class="trait" href="../../core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="../../alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><T>> for <a class="struct" href="../../alloc/boxed/struct.PinBox.html" title="struct alloc::boxed::PinBox">PinBox</a><T></code><a href='#impl-From%3CBox%3CT%3E%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/boxed.rs.html#858-862' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.from' class="method"><span id='from.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(boxed: <a class="struct" href="../../alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><T>) -> <a class="struct" href="../../alloc/boxed/struct.PinBox.html" title="struct alloc::boxed::PinBox">PinBox</a><T></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/boxed.rs.html#859-861' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Performs the conversion.</p> </div></div><h3 id='impl-From%3CPinBox%3CT%3E%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<T: <a class="trait" href="../../core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + ?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> <a class="trait" href="../../core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="../../alloc/boxed/struct.PinBox.html" title="struct alloc::boxed::PinBox">PinBox</a><T>> for <a class="struct" href="../../alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><T></code><a href='#impl-From%3CPinBox%3CT%3E%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/boxed.rs.html#865-869' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.from-1' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../../alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><I></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../../alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><I></h3><code class="content"><span class="where fmt-newline">impl<I: <a class="trait" href="../../core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> + ?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> <a class="trait" href="../../core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> for <a class="struct" href="../../alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><I></span><span class="where fmt-newline"> type <a href='../../core/iter/iterator/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = I::<a class="type" href="../../core/iter/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::iterator::Iterator::Item">Item</a>;</span></code></div></div><span id='from.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(pinned: <a class="struct" href="../../alloc/boxed/struct.PinBox.html" title="struct alloc::boxed::PinBox">PinBox</a><T>) -> <a class="struct" href="../../alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><T></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/boxed.rs.html#866-868' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Performs the conversion.</p> </div></div><h3 id='impl-Deref' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<T: ?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> <a class="trait" href="../../core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="../../alloc/boxed/struct.PinBox.html" title="struct alloc::boxed::PinBox">PinBox</a><T></code><a href='#impl-Deref' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/boxed.rs.html#872-878' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Target' class="type"><span id='Target.t' class='invisible'><code>type <a href='../../core/ops/deref/trait.Deref.html#associatedtype.Target' class="type">Target</a> = T</code></span></h4> <div class='docblock'><p>The resulting type after dereferencing.</p> </div><h4 id='method.deref' class="method"><span id='deref.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../core/ops/deref/trait.Deref.html#tymethod.deref' class='fnname'>deref</a>(&self) -> &T</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/boxed.rs.html#875-877' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Dereferences the value.</p> </div></div><h3 id='impl-DerefMut' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<T: <a class="trait" href="../../core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + ?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> <a class="trait" href="../../core/ops/deref/trait.DerefMut.html" title="trait core::ops::deref::DerefMut">DerefMut</a> for <a class="struct" href="../../alloc/boxed/struct.PinBox.html" title="struct alloc::boxed::PinBox">PinBox</a><T></code><a href='#impl-DerefMut' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/boxed.rs.html#881-885' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.deref_mut' class="method"><span id='deref_mut.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../core/ops/deref/trait.DerefMut.html#tymethod.deref_mut' class='fnname'>deref_mut</a>(&mut self) -> &mut T</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/boxed.rs.html#882-884' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Mutably dereferences the value.</p> </div></div><h3 id='impl-Display' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<T: <a class="trait" href="../../alloc/fmt/trait.Display.html" title="trait alloc::fmt::Display">Display</a> + ?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> <a class="trait" href="../../alloc/fmt/trait.Display.html" title="trait alloc::fmt::Display">Display</a> for <a class="struct" href="../../alloc/boxed/struct.PinBox.html" title="struct alloc::boxed::PinBox">PinBox</a><T></code><a href='#impl-Display' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/boxed.rs.html#888-892' 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.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="../../alloc/fmt/struct.Formatter.html" title="struct alloc::fmt::Formatter">Formatter</a>) -> <a class="type" href="../../alloc/fmt/type.Result.html" title="type alloc::fmt::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/boxed.rs.html#889-891' 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.Display.html#tymethod.fmt">Read more</a></p> </div></div><h3 id='impl-Debug' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<T: <a class="trait" href="../../alloc/fmt/trait.Debug.html" title="trait alloc::fmt::Debug">Debug</a> + ?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> <a class="trait" href="../../alloc/fmt/trait.Debug.html" title="trait alloc::fmt::Debug">Debug</a> for <a class="struct" href="../../alloc/boxed/struct.PinBox.html" title="struct alloc::boxed::PinBox">PinBox</a><T></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/alloc/boxed.rs.html#895-899' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.fmt-1' class="method"><span id='fmt.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../alloc/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="../../alloc/fmt/struct.Formatter.html" title="struct alloc::fmt::Formatter">Formatter</a>) -> <a class="type" href="../../alloc/fmt/type.Result.html" title="type alloc::fmt::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/boxed.rs.html#896-898' 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-Pointer' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<T: ?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> <a class="trait" href="../../alloc/fmt/trait.Pointer.html" title="trait alloc::fmt::Pointer">Pointer</a> for <a class="struct" href="../../alloc/boxed/struct.PinBox.html" title="struct alloc::boxed::PinBox">PinBox</a><T></code><a href='#impl-Pointer' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/boxed.rs.html#902-909' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.fmt-2' class="method"><span id='fmt.v-2' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../alloc/fmt/trait.Pointer.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="../../alloc/fmt/struct.Formatter.html" title="struct alloc::fmt::Formatter">Formatter</a>) -> <a class="type" href="../../alloc/fmt/type.Result.html" title="type alloc::fmt::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/boxed.rs.html#903-908' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Formats the value using the given formatter.</p> </div></div><h3 id='impl-CoerceUnsized%3CPinBox%3CU%3E%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<T: ?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="../../core/marker/trait.Unsize.html" title="trait core::marker::Unsize">Unsize</a><U>, U: ?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> <a class="trait" href="../../core/ops/unsize/trait.CoerceUnsized.html" title="trait core::ops::unsize::CoerceUnsized">CoerceUnsized</a><<a class="struct" href="../../alloc/boxed/struct.PinBox.html" title="struct alloc::boxed::PinBox">PinBox</a><U>> for <a class="struct" href="../../alloc/boxed/struct.PinBox.html" title="struct alloc::boxed::PinBox">PinBox</a><T></code><a href='#impl-CoerceUnsized%3CPinBox%3CU%3E%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/boxed.rs.html#912' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<T: ?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> <a class="trait" href="../../core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../alloc/boxed/struct.PinBox.html" title="struct alloc::boxed::PinBox">PinBox</a><T></code><a href='#impl-Unpin' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/boxed.rs.html#915' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-Future' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<'a, F: ?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="../../core/future/trait.Future.html" title="trait core::future::Future">Future</a>> <a class="trait" href="../../core/future/trait.Future.html" title="trait core::future::Future">Future</a> for <a class="struct" href="../../alloc/boxed/struct.PinBox.html" title="struct alloc::boxed::PinBox">PinBox</a><F></code><a href='#impl-Future' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/boxed.rs.html#927-933' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Output' class="type"><span id='Output.t' class='invisible'><code>type <a href='../../core/future/trait.Future.html#associatedtype.Output' class="type">Output</a> = F::<a class="type" href="../../core/future/trait.Future.html#associatedtype.Output" title="type core::future::Future::Output">Output</a></code></span></h4> <div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API. (<code>futures_api </code><a href="https://github.com/rust-lang/rust/issues/50547">#50547</a>)</summary><p>futures in libcore are unstable</p> </details></div></div><div class='docblock'><p>The result of the <code>Future</code>.</p> </div><h4 id='method.poll' class="method"><span id='poll.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../core/future/trait.Future.html#tymethod.poll' class='fnname'>poll</a>(self: <a class="struct" href="../../core/mem/struct.PinMut.html" title="struct core::mem::PinMut">PinMut</a><Self>, cx: &mut <a class="struct" href="../../alloc/task/struct.Context.html" title="struct alloc::task::Context">Context</a>) -> <a class="enum" href="../../alloc/task/enum.Poll.html" title="enum alloc::task::Poll">Poll</a><Self::<a class="type" href="../../core/future/trait.Future.html#associatedtype.Output" title="type core::future::Future::Output">Output</a>></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/boxed.rs.html#930-932' 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>futures_api </code><a href="https://github.com/rust-lang/rust/issues/50547">#50547</a>)</summary><p>futures in libcore are unstable</p> </details></div></div><div class='docblock'><p>Attempt to resolve the future to a final value, registering the current task for wakeup if the value is not yet available. <a href="../../core/future/trait.Future.html#tymethod.poll">Read more</a></p> </div></div><h3 id='impl-UnsafeTask' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<F: <a class="trait" href="../../core/future/trait.Future.html" title="trait core::future::Future">Future</a><Output = ()> + <a class="trait" href="../../core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'static> <a class="trait" href="../../alloc/task/trait.UnsafeTask.html" title="trait alloc::task::UnsafeTask">UnsafeTask</a> for <a class="struct" href="../../alloc/boxed/struct.PinBox.html" title="struct alloc::boxed::PinBox">PinBox</a><F></code><a href='#impl-UnsafeTask' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/boxed.rs.html#936-950' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.into_raw-1' class="method"><span id='into_raw.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../alloc/task/trait.UnsafeTask.html#tymethod.into_raw' class='fnname'>into_raw</a>(self) -> *mut ()</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/boxed.rs.html#937-939' 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>futures_api </code><a href="https://github.com/rust-lang/rust/issues/50547">#50547</a>)</summary><p>futures in libcore are unstable</p> </details></div></div><div class='docblock'><p>Convert a owned instance into a (conceptually owned) void pointer.</p> </div><h4 id='method.poll-1' class="method"><span id='poll.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>unsafe fn <a href='../../alloc/task/trait.UnsafeTask.html#tymethod.poll' class='fnname'>poll</a>(task: *mut (), cx: &mut <a class="struct" href="../../alloc/task/struct.Context.html" title="struct alloc::task::Context">Context</a>) -> <a class="enum" href="../../alloc/task/enum.Poll.html" title="enum alloc::task::Poll">Poll</a><()></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/boxed.rs.html#941-945' 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>futures_api </code><a href="https://github.com/rust-lang/rust/issues/50547">#50547</a>)</summary><p>futures in libcore are unstable</p> </details></div></div><div class='docblock'><p>Poll the task represented by the given void pointer. <a href="../../alloc/task/trait.UnsafeTask.html#tymethod.poll">Read more</a></p> </div><h4 id='method.drop' class="method"><span id='drop.v' class='invisible'><table class='table-display'><tbody><tr><td><code>unsafe fn <a href='../../alloc/task/trait.UnsafeTask.html#tymethod.drop' class='fnname'>drop</a>(task: *mut ())</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/boxed.rs.html#947-949' 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>futures_api </code><a href="https://github.com/rust-lang/rust/issues/50547">#50547</a>)</summary><p>futures in libcore are unstable</p> </details></div></div><div class='docblock'><p>Drops the task represented by the given void pointer. <a href="../../alloc/task/trait.UnsafeTask.html#tymethod.drop">Read more</a></p> </div></div><h3 id='impl-From%3CPinBox%3CF%3E%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<F: <a class="trait" href="../../core/future/trait.Future.html" title="trait core::future::Future">Future</a><Output = ()> + <a class="trait" href="../../core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'static> <a class="trait" href="../../core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="../../alloc/boxed/struct.PinBox.html" title="struct alloc::boxed::PinBox">PinBox</a><F>> for <a class="struct" href="../../alloc/task/struct.TaskObj.html" title="struct alloc::task::TaskObj">TaskObj</a></code><a href='#impl-From%3CPinBox%3CF%3E%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/boxed.rs.html#953-957' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.from-2' class="method"><span id='from.v-2' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(boxed: <a class="struct" href="../../alloc/boxed/struct.PinBox.html" title="struct alloc::boxed::PinBox">PinBox</a><F>) -> Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/boxed.rs.html#954-956' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Performs the conversion.</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<T: ?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> <a class="trait" href="../../core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../alloc/boxed/struct.PinBox.html" title="struct alloc::boxed::PinBox">PinBox</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>, </span></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<T: ?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> <a class="trait" href="../../core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../alloc/boxed/struct.PinBox.html" title="struct alloc::boxed::PinBox">PinBox</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>, </span></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>⏎</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>