<!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 `Send` trait in crate `core`."> <meta name="keywords" content="rust, rustlang, rust-lang, Send"> <title>core::marker::Send - 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 trait"> <!--[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'>Trait Send</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>core</a>::<wbr><a href='index.html'>marker</a></p><script>window.sidebarCurrent = {name: 'Send', ty: 'trait', 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'>Trait <a href='../index.html'>core</a>::<wbr><a href='index.html'>marker</a>::<wbr><a class="trait" href=''>Send</a></span><span class='out-of-band'><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</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/marker.rs.html#43-45' title='goto source code'>[src]</a></span></h1> <pre class='rust trait'>pub unsafe auto trait Send { }</pre><div class='docblock'><p>Types that can be transferred across thread boundaries.</p> <p>This trait is automatically implemented when the compiler determines it's appropriate.</p> <p>An example of a non-<code>Send</code> type is the reference-counting pointer <a href="../../std/rc/struct.Rc.html"><code>rc::Rc</code></a>. If two threads attempt to clone <a href="../../std/rc/struct.Rc.html"><code>Rc</code></a>s that point to the same reference-counted value, they might try to update the reference count at the same time, which is <a href="../../reference/behavior-considered-undefined.html">undefined behavior</a> because <a href="../../std/rc/struct.Rc.html"><code>Rc</code></a> doesn't use atomic operations. Its cousin <a href="../../std/sync/struct.Arc.html"><code>sync::Arc</code></a> does use atomic operations (incurring some overhead) and thus is <code>Send</code>.</p> <p>See <a href="../../nomicon/send-and-sync.html">the Nomicon</a> for more details.</p> </div> <h2 id='implementors' class='small-section-header'> Implementors<a href='#implementors' class='anchor'></a> </h2> <ul class='item-list' id='implementors-list'> <li><div class='out-of-band'><a class='srclink' href='../../src/core/ptr.rs.html#2358' title='goto source code'>[src]</a></div><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>> Send for <a class="struct" href="../../core/ptr/struct.Unique.html" title="struct core::ptr::Unique">Unique</a><T></code></li> <li><div class='out-of-band'><a class='srclink' href='../../src/core/ptr.rs.html#2493' title='goto source code'>[src]</a></div><code>impl<T: ?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> !Send for <a class="struct" href="../../core/ptr/struct.NonNull.html" title="struct core::ptr::NonNull">NonNull</a><T></code></li> <li><div class='out-of-band'><a class='srclink' href='../../src/core/marker.rs.html#546' title='goto source code'>[src]</a></div><code>impl<'a, 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>> Send for &'a T</code></li> <li><div class='out-of-band'><a class='srclink' href='../../src/core/marker.rs.html#548' title='goto source code'>[src]</a></div><code>impl<'a, 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>> Send for &'a mut T</code></li> <li><div class='out-of-band'><a class='srclink' href='../../src/core/marker.rs.html#48' title='goto source code'>[src]</a></div><code>impl<T: ?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> !Send for *const T</code></li> <li><div class='out-of-band'><a class='srclink' href='../../src/core/marker.rs.html#50' title='goto source code'>[src]</a></div><code>impl<T: ?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> !Send for *mut T</code></li> <li><div class='out-of-band'><a class='srclink' href='../../src/core/sync/atomic.rs.html#164' title='goto source code'>[src]</a></div><code>impl<T> Send for <a class="struct" href="../../core/sync/atomic/struct.AtomicPtr.html" title="struct core::sync::atomic::AtomicPtr">AtomicPtr</a><T></code></li> <li><div class='out-of-band'><a class='srclink' href='../../src/core/cell.rs.html#245' title='goto source code'>[src]</a></div><code>impl<T> Send for <a class="struct" href="../../core/cell/struct.Cell.html" title="struct core::cell::Cell">Cell</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></li> <li><div class='out-of-band'><a class='srclink' href='../../src/core/cell.rs.html#859' title='goto source code'>[src]</a></div><code>impl<T: ?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> Send for <a class="struct" href="../../core/cell/struct.RefCell.html" title="struct core::cell::RefCell">RefCell</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></li> <li><div class='out-of-band'><a class='srclink' href='../../src/core/slice/mod.rs.html#1408' title='goto source code'>[src]</a></div><code>impl<'a, T: <a class="trait" href="../../core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>> Send for <a class="struct" href="../../core/slice/struct.Iter.html" title="struct core::slice::Iter">Iter</a><'a, T></code></li> <li><div class='out-of-band'><a class='srclink' href='../../src/core/slice/mod.rs.html#1525' title='goto source code'>[src]</a></div><code>impl<'a, T: <a class="trait" href="../../core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>> Send for <a class="struct" href="../../core/slice/struct.IterMut.html" title="struct core::slice::IterMut">IterMut</a><'a, T></code></li> </ul><script type="text/javascript" async src="../../implementors/core/marker/trait.Send.js"> </script></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>