<!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 `Unique` struct in crate `core`."> <meta name="keywords" content="rust, rustlang, rust-lang, Unique"> <title>core::ptr::Unique - 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="../../main.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='../../core/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 Unique</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.empty">empty</a><a href="#method.new_unchecked">new_unchecked</a><a href="#method.new">new</a><a href="#method.as_ptr">as_ptr</a><a href="#method.as_ref">as_ref</a><a href="#method.as_mut">as_mut</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-CoerceUnsized%3CUnique%3CU%3E%3E">CoerceUnsized<Unique<U>></a><a href="#impl-Pointer">Pointer</a><a href="#impl-From%3C%26%27a%20mut%20T%3E">From<&'a mut T></a><a href="#impl-From%3C%26%27a%20T%3E">From<&'a T></a><a href="#impl-From%3CNonNull%3CT%3E%3E">From<NonNull<T>></a><a href="#impl-From%3CUnique%3CT%3E%3E">From<Unique<T>></a></div></div><p class='location'><a href='../index.html'>core</a>::<wbr><a href='index.html'>ptr</a></p><script>window.sidebarCurrent = {name: 'Unique', 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"> </div> </form> </nav> <section id='main' class="content"> <h1 class='fqn'><span class='in-band'>Struct <a href='../index.html'>core</a>::<wbr><a href='index.html'>ptr</a>::<wbr><a class="struct" href=''>Unique</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/core/ptr.rs.html#2336-2344' title='goto source code'>[src]</a></span></h1> <pre class='rust struct'>pub struct Unique<T: ?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> { /* fields omitted */ }</pre><div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API. (<code>ptr_internals</code>)</summary><p>use NonNull instead and consider PhantomData<T> (if you also use #[may_dangle]), Send, and/or Sync</p> </details></div></div><div class='docblock'><p>A wrapper around a raw non-null <code>*mut T</code> that indicates that the possessor of this wrapper owns the referent. Useful for building abstractions like <code>Box<T></code>, <code>Vec<T></code>, <code>String</code>, and <code>HashMap<K, V></code>.</p> <p>Unlike <code>*mut T</code>, <code>Unique<T></code> behaves "as if" it were an instance of <code>T</code>. It implements <code>Send</code>/<code>Sync</code> if <code>T</code> is <code>Send</code>/<code>Sync</code>. It also implies the kind of strong aliasing guarantees an instance of <code>T</code> can expect: the referent of the pointer should not be modified without a unique path to its owning Unique.</p> <p>If you're uncertain of whether it's correct to use <code>Unique</code> for your purposes, consider using <code>NonNull</code>, which has weaker semantics.</p> <p>Unlike <code>*mut T</code>, the pointer must always be non-null, even if the pointer is never dereferenced. This is so that enums may use this forbidden value as a discriminant -- <code>Option<Unique<T>></code> has the same size as <code>Unique<T></code>. However the pointer may still dangle if it isn't dereferenced.</p> <p>Unlike <code>*mut T</code>, <code>Unique<T></code> is covariant over <code>T</code>. This should always be correct for any type which upholds Unique's aliasing 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'><code>impl<T: <a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> <a class="struct" href="../../core/ptr/struct.Unique.html" title="struct core::ptr::Unique">Unique</a><T></code><a href='#impl' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/ptr.rs.html#2368-2380' title='goto source code'>[src]</a></span></h3> <div class='impl-items'><h4 id='method.empty' class="method"><span id='empty.v' class='invisible'><code>pub fn <a href='#method.empty' class='fnname'>empty</a>() -> Self</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/ptr.rs.html#2374-2379' title='goto source code'>[src]</a></span></h4> <div class='stability'><div class='stab unstable'><span class=microscope>🔬</span> This is a nightly-only experimental API. (<code>ptr_internals</code>)</div></div><div class='docblock'><p>Creates a new <code>Unique</code> that is dangling, but well-aligned.</p> <p>This is useful for initializing types which lazily allocate, like <code>Vec::new</code> does.</p> </div></div><h3 id='impl-1' class='impl'><span class='in-band'><code>impl<T: ?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> <a class="struct" href="../../core/ptr/struct.Unique.html" title="struct core::ptr::Unique">Unique</a><T></code><a href='#impl-1' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/ptr.rs.html#2383-2420' title='goto source code'>[src]</a></span></h3> <div class='impl-items'><h4 id='method.new_unchecked' class="method"><span id='new_unchecked.v' class='invisible'><code>pub const unsafe fn <a href='#method.new_unchecked' class='fnname'>new_unchecked</a>(ptr: *mut T) -> Self</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/ptr.rs.html#2389-2391' title='goto source code'>[src]</a></span></h4> <div class='stability'><div class='stab unstable'><span class=microscope>🔬</span> This is a nightly-only experimental API. (<code>ptr_internals</code>)</div></div><div class='docblock'><p>Creates a new <code>Unique</code>.</p> <h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1> <p><code>ptr</code> must be non-null.</p> </div><h4 id='method.new' class="method"><span id='new.v' class='invisible'><code>pub fn <a href='#method.new' class='fnname'>new</a>(ptr: *mut T) -> <a class="enum" href="../../core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/ptr.rs.html#2394-2396' title='goto source code'>[src]</a></span></h4> <div class='stability'><div class='stab unstable'><span class=microscope>🔬</span> This is a nightly-only experimental API. (<code>ptr_internals</code>)</div></div><div class='docblock'><p>Creates a new <code>Unique</code> if <code>ptr</code> is non-null.</p> </div><h4 id='method.as_ptr' class="method"><span id='as_ptr.v' class='invisible'><code>pub fn <a href='#method.as_ptr' class='fnname'>as_ptr</a>(self) -> *mut T</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/ptr.rs.html#2399-2401' title='goto source code'>[src]</a></span></h4> <div class='stability'><div class='stab unstable'><span class=microscope>🔬</span> This is a nightly-only experimental API. (<code>ptr_internals</code>)</div></div><div class='docblock'><p>Acquires the underlying <code>*mut</code> pointer.</p> </div><h4 id='method.as_ref' class="method"><span id='as_ref.v' class='invisible'><code>pub unsafe fn <a href='#method.as_ref' class='fnname'>as_ref</a>(&self) -> &T</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/ptr.rs.html#2408-2410' title='goto source code'>[src]</a></span></h4> <div class='stability'><div class='stab unstable'><span class=microscope>🔬</span> This is a nightly-only experimental API. (<code>ptr_internals</code>)</div></div><div class='docblock'><p>Dereferences the content.</p> <p>The resulting lifetime is bound to self so this behaves "as if" it were actually an instance of T that is getting borrowed. If a longer (unbound) lifetime is needed, use <code>&*my_ptr.as_ptr()</code>.</p> </div><h4 id='method.as_mut' class="method"><span id='as_mut.v' class='invisible'><code>pub unsafe fn <a href='#method.as_mut' class='fnname'>as_mut</a>(&mut self) -> &mut T</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/ptr.rs.html#2417-2419' title='goto source code'>[src]</a></span></h4> <div class='stability'><div class='stab unstable'><span class=microscope>🔬</span> This is a nightly-only experimental API. (<code>ptr_internals</code>)</div></div><div class='docblock'><p>Mutably dereferences the content.</p> <p>The resulting lifetime is bound to self so this behaves "as if" it were actually an instance of T that is getting borrowed. If a longer (unbound) lifetime is needed, use <code>&mut *my_ptr.as_ptr()</code>.</p> </div></div> <h2 id='implementations' class='small-section-header'> Trait Implementations<a href='#implementations' class='anchor'></a> </h2> <h3 id='impl-Debug' class='impl'><span class='in-band'><code>impl<T: ?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> <a class="trait" href="../../core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../core/ptr/struct.Unique.html" title="struct core::ptr::Unique">Unique</a><T></code><a href='#impl-Debug' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/ptr.rs.html#2347-2351' title='goto source code'>[src]</a></span></h3> <div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><code>fn <a href='../../core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="../../core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="../../core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/ptr.rs.html#2348-2350' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>Formats the value using the given formatter. <a href="../../core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p> </div></div><h3 id='impl-Send' class='impl'><span class='in-band'><code>impl<T: <a class="trait" href="../../core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + ?<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="../../core/ptr/struct.Unique.html" title="struct core::ptr::Unique">Unique</a><T></code><a href='#impl-Send' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/ptr.rs.html#2358' title='goto source code'>[src]</a></span></h3> <div class='docblock'><p><code>Unique</code> pointers are <code>Send</code> if <code>T</code> is <code>Send</code> because the data they reference is unaliased. Note that this aliasing invariant is unenforced by the type system; the abstraction using the <code>Unique</code> must enforce it.</p> </div><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><span class='in-band'><code>impl<T: <a class="trait" href="../../core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + ?<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="../../core/ptr/struct.Unique.html" title="struct core::ptr::Unique">Unique</a><T></code><a href='#impl-Sync' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/ptr.rs.html#2365' title='goto source code'>[src]</a></span></h3> <div class='docblock'><p><code>Unique</code> pointers are <code>Sync</code> if <code>T</code> is <code>Sync</code> because the data they reference is unaliased. Note that this aliasing invariant is unenforced by the type system; the abstraction using the <code>Unique</code> must enforce it.</p> </div><div class='impl-items'></div><h3 id='impl-Clone' class='impl'><span class='in-band'><code>impl<T: ?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> <a class="trait" href="../../core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../core/ptr/struct.Unique.html" title="struct core::ptr::Unique">Unique</a><T></code><a href='#impl-Clone' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/ptr.rs.html#2423-2427' title='goto source code'>[src]</a></span></h3> <div class='impl-items'><h4 id='method.clone' class="method"><span id='clone.v' class='invisible'><code>fn <a href='../../core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> Self</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/ptr.rs.html#2424-2426' title='goto source code'>[src]</a></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'><code>fn <a href='../../core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: &Self)</code></span><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#112-114' title='goto source code'>[src]</a></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'><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.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="struct" href="../../core/ptr/struct.Unique.html" title="struct core::ptr::Unique">Unique</a><T></code><a href='#impl-Copy' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/ptr.rs.html#2430' title='goto source code'>[src]</a></span></h3> <div class='impl-items'></div><h3 id='impl-CoerceUnsized%3CUnique%3CU%3E%3E' class='impl'><span class='in-band'><code>impl<T: ?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, U: ?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> <a class="trait" href="../../core/ops/trait.CoerceUnsized.html" title="trait core::ops::CoerceUnsized">CoerceUnsized</a><<a class="struct" href="../../core/ptr/struct.Unique.html" title="struct core::ptr::Unique">Unique</a><U>> for <a class="struct" href="../../core/ptr/struct.Unique.html" title="struct core::ptr::Unique">Unique</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../core/marker/trait.Unsize.html" title="trait core::marker::Unsize">Unsize</a><U>, </span></code><a href='#impl-CoerceUnsized%3CUnique%3CU%3E%3E' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/ptr.rs.html#2433' title='goto source code'>[src]</a></span></h3> <div class='impl-items'></div><h3 id='impl-Pointer' class='impl'><span class='in-band'><code>impl<T: ?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> <a class="trait" href="../../core/fmt/trait.Pointer.html" title="trait core::fmt::Pointer">Pointer</a> for <a class="struct" href="../../core/ptr/struct.Unique.html" title="struct core::ptr::Unique">Unique</a><T></code><a href='#impl-Pointer' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/ptr.rs.html#2436-2440' title='goto source code'>[src]</a></span></h3> <div class='impl-items'><h4 id='method.fmt-1' class="method"><span id='fmt.v-1' class='invisible'><code>fn <a href='../../core/fmt/trait.Pointer.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="../../core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="../../core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/ptr.rs.html#2437-2439' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>Formats the value using the given formatter.</p> </div></div><h3 id='impl-From%3C%26%27a%20mut%20T%3E' class='impl'><span class='in-band'><code>impl<'a, 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 mut T> for <a class="struct" href="../../core/ptr/struct.Unique.html" title="struct core::ptr::Unique">Unique</a><T></code><a href='#impl-From%3C%26%27a%20mut%20T%3E' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/ptr.rs.html#2443-2447' title='goto source code'>[src]</a></span></h3> <div class='impl-items'><h4 id='method.from' class="method"><span id='from.v' class='invisible'><code>fn <a href='../../core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(reference: &'a mut T) -> Self</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/ptr.rs.html#2444-2446' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>Performs the conversion.</p> </div></div><h3 id='impl-From%3C%26%27a%20T%3E' class='impl'><span class='in-band'><code>impl<'a, 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 T> for <a class="struct" href="../../core/ptr/struct.Unique.html" title="struct core::ptr::Unique">Unique</a><T></code><a href='#impl-From%3C%26%27a%20T%3E' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/ptr.rs.html#2450-2454' title='goto source code'>[src]</a></span></h3> <div class='impl-items'><h4 id='method.from-1' class="method"><span id='from.v-1' class='invisible'><code>fn <a href='../../core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(reference: &'a T) -> Self</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/ptr.rs.html#2451-2453' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>Performs the conversion.</p> </div></div><h3 id='impl-From%3CNonNull%3CT%3E%3E' class='impl'><span class='in-band'><code>impl<'a, 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="../../core/ptr/struct.NonNull.html" title="struct core::ptr::NonNull">NonNull</a><T>> for <a class="struct" href="../../core/ptr/struct.Unique.html" title="struct core::ptr::Unique">Unique</a><T></code><a href='#impl-From%3CNonNull%3CT%3E%3E' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/ptr.rs.html#2457-2461' title='goto source code'>[src]</a></span></h3> <div class='impl-items'><h4 id='method.from-2' class="method"><span id='from.v-2' class='invisible'><code>fn <a href='../../core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(p: <a class="struct" href="../../core/ptr/struct.NonNull.html" title="struct core::ptr::NonNull">NonNull</a><T>) -> Self</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/ptr.rs.html#2458-2460' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>Performs the conversion.</p> </div></div><h3 id='impl-From%3CUnique%3CT%3E%3E' class='impl'><span class='in-band'><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="../../core/ptr/struct.Unique.html" title="struct core::ptr::Unique">Unique</a><T>> for <a class="struct" href="../../core/ptr/struct.NonNull.html" title="struct core::ptr::NonNull">NonNull</a><T></code><a href='#impl-From%3CUnique%3CT%3E%3E' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.25.0'>1.25.0</div><a class='srclink' href='../../src/core/ptr.rs.html#2625-2629' title='goto source code'>[src]</a></span></h3> <div class='impl-items'><h4 id='method.from-3' class="method"><span id='from.v-3' class='invisible'><code>fn <a href='../../core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(unique: <a class="struct" href="../../core/ptr/struct.Unique.html" title="struct core::ptr::Unique">Unique</a><T>) -> Self</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/ptr.rs.html#2626-2628' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>Performs the conversion.</p> </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> </div> </div> </aside> <script> window.rootPath = "../../"; window.currentCrate = "core"; </script> <script src="../../main.js"></script> <script defer src="../../search-index.js"></script> </body> </html>