<!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 `SyncSender` struct in crate `std`."> <meta name="keywords" content="rust, rustlang, rust-lang, SyncSender"> <title>std::sync::mpsc::SyncSender - 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='../../../std/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='logo' width='100'></a> <p class='location'>Struct SyncSender</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.send">send</a><a href="#method.try_send">try_send</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Clone">Clone</a><a href="#impl-Drop">Drop</a><a href="#impl-Debug">Debug</a></div></div><p class='location'><a href='../../index.html'>std</a>::<wbr><a href='../index.html'>sync</a>::<wbr><a href='index.html'>mpsc</a></p><script>window.sidebarCurrent = {name: 'SyncSender', 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'>std</a>::<wbr><a href='../index.html'>sync</a>::<wbr><a href='index.html'>mpsc</a>::<wbr><a class="struct" href=''>SyncSender</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/std/sync/mpsc/mod.rs.html#551-553' title='goto source code'>[src]</a></span></h1> <pre class='rust struct'>pub struct SyncSender<T> { /* fields omitted */ }</pre><div class='docblock'><p>The sending-half of Rust's synchronous <a href="fn.sync_channel.html"><code>sync_channel</code></a> type.</p> <p>Messages can be sent through this channel with <a href="struct.SyncSender.html#method.send"><code>send</code></a> or <a href="struct.SyncSender.html#method.try_send"><code>try_send</code></a>.</p> <p><a href="struct.SyncSender.html#method.send"><code>send</code></a> will block if there is no space in the internal buffer.</p> <h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1> <pre class="rust rust-example-rendered"> <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">mpsc</span>::<span class="ident">sync_channel</span>; <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">thread</span>; <span class="comment">// Create a sync_channel with buffer size 2</span> <span class="kw">let</span> (<span class="ident">sync_sender</span>, <span class="ident">receiver</span>) <span class="op">=</span> <span class="ident">sync_channel</span>(<span class="number">2</span>); <span class="kw">let</span> <span class="ident">sync_sender2</span> <span class="op">=</span> <span class="ident">sync_sender</span>.<span class="ident">clone</span>(); <span class="comment">// First thread owns sync_sender</span> <span class="ident">thread</span>::<span class="ident">spawn</span>(<span class="kw">move</span> <span class="op">||</span> { <span class="ident">sync_sender</span>.<span class="ident">send</span>(<span class="number">1</span>).<span class="ident">unwrap</span>(); <span class="ident">sync_sender</span>.<span class="ident">send</span>(<span class="number">2</span>).<span class="ident">unwrap</span>(); }); <span class="comment">// Second thread owns sync_sender2</span> <span class="ident">thread</span>::<span class="ident">spawn</span>(<span class="kw">move</span> <span class="op">||</span> { <span class="ident">sync_sender2</span>.<span class="ident">send</span>(<span class="number">3</span>).<span class="ident">unwrap</span>(); <span class="comment">// thread will now block since the buffer is full</span> <span class="macro">println</span><span class="macro">!</span>(<span class="string">"Thread unblocked!"</span>); }); <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">msg</span>; <span class="ident">msg</span> <span class="op">=</span> <span class="ident">receiver</span>.<span class="ident">recv</span>().<span class="ident">unwrap</span>(); <span class="macro">println</span><span class="macro">!</span>(<span class="string">"message {} received"</span>, <span class="ident">msg</span>); <span class="comment">// "Thread unblocked!" will be printed now</span> <span class="ident">msg</span> <span class="op">=</span> <span class="ident">receiver</span>.<span class="ident">recv</span>().<span class="ident">unwrap</span>(); <span class="macro">println</span><span class="macro">!</span>(<span class="string">"message {} received"</span>, <span class="ident">msg</span>); <span class="ident">msg</span> <span class="op">=</span> <span class="ident">receiver</span>.<span class="ident">recv</span>().<span class="ident">unwrap</span>(); <span class="macro">println</span><span class="macro">!</span>(<span class="string">"message {} received"</span>, <span class="ident">msg</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Async%3A%3Ampsc%3A%3Async_channel%3B%0Ause%20std%3A%3Athread%3B%0A%0A%2F%2F%20Create%20a%20sync_channel%20with%20buffer%20size%202%0Alet%20(sync_sender%2C%20receiver)%20%3D%20sync_channel(2)%3B%0Alet%20sync_sender2%20%3D%20sync_sender.clone()%3B%0A%0A%2F%2F%20First%20thread%20owns%20sync_sender%0Athread%3A%3Aspawn(move%20%7C%7C%20%7B%0A%20%20%20%20sync_sender.send(1).unwrap()%3B%0A%20%20%20%20sync_sender.send(2).unwrap()%3B%0A%7D)%3B%0A%0A%2F%2F%20Second%20thread%20owns%20sync_sender2%0Athread%3A%3Aspawn(move%20%7C%7C%20%7B%0A%20%20%20%20sync_sender2.send(3).unwrap()%3B%0A%20%20%20%20%2F%2F%20thread%20will%20now%20block%20since%20the%20buffer%20is%20full%0A%20%20%20%20println!(%22Thread%20unblocked!%22)%3B%0A%7D)%3B%0A%0Alet%20mut%20msg%3B%0A%0Amsg%20%3D%20receiver.recv().unwrap()%3B%0Aprintln!(%22message%20%7B%7D%20received%22%2C%20msg)%3B%0A%0A%2F%2F%20%22Thread%20unblocked!%22%20will%20be%20printed%20now%0A%0Amsg%20%3D%20receiver.recv().unwrap()%3B%0Aprintln!(%22message%20%7B%7D%20received%22%2C%20msg)%3B%0A%0Amsg%20%3D%20receiver.recv().unwrap()%3B%0A%0Aprintln!(%22message%20%7B%7D%20received%22%2C%20msg)%3B%0A%7D">Run</a></pre> </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="struct" href="../../../std/sync/mpsc/struct.SyncSender.html" title="struct std::sync::mpsc::SyncSender">SyncSender</a><T></code><a href='#impl' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/std/sync/mpsc/mod.rs.html#932-1034' title='goto source code'>[src]</a></span></h3> <div class='impl-items'><h4 id='method.send' class="method"><span id='send.v' class='invisible'><code>pub fn <a href='#method.send' class='fnname'>send</a>(&self, t: T) -> <a class="enum" href="../../../std/result/enum.Result.html" title="enum std::result::Result">Result</a><<a class="primitive" href="../../primitive.unit.html">()</a>, <a class="struct" href="../../../std/sync/mpsc/struct.SendError.html" title="struct std::sync::mpsc::SendError">SendError</a><T>></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/std/sync/mpsc/mod.rs.html#977-979' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>Sends a value on this synchronous channel.</p> <p>This function will <em>block</em> until space in the internal buffer becomes available or a receiver is available to hand off the message to.</p> <p>Note that a successful send does <em>not</em> guarantee that the receiver will ever see the data if there is a buffer on this channel. Items may be enqueued in the internal buffer for the receiver to receive at a later time. If the buffer size is 0, however, the channel becomes a rendezvous channel and it guarantees that the receiver has indeed received the data if this function returns success.</p> <p>This function will never panic, but it may return <a href="../../../std/result/enum.Result.html#variant.Err"><code>Err</code></a> if the <a href="../../../std/sync/mpsc/struct.Receiver.html"><code>Receiver</code></a> has disconnected and is no longer able to receive information.</p> <h1 id="examples-1" class="section-header"><a href="#examples-1">Examples</a></h1> <pre class="rust rust-example-rendered"> <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">mpsc</span>::<span class="ident">sync_channel</span>; <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">thread</span>; <span class="comment">// Create a rendezvous sync_channel with buffer size 0</span> <span class="kw">let</span> (<span class="ident">sync_sender</span>, <span class="ident">receiver</span>) <span class="op">=</span> <span class="ident">sync_channel</span>(<span class="number">0</span>); <span class="ident">thread</span>::<span class="ident">spawn</span>(<span class="kw">move</span> <span class="op">||</span> { <span class="macro">println</span><span class="macro">!</span>(<span class="string">"sending message..."</span>); <span class="ident">sync_sender</span>.<span class="ident">send</span>(<span class="number">1</span>).<span class="ident">unwrap</span>(); <span class="comment">// Thread is now blocked until the message is received</span> <span class="macro">println</span><span class="macro">!</span>(<span class="string">"...message received!"</span>); }); <span class="kw">let</span> <span class="ident">msg</span> <span class="op">=</span> <span class="ident">receiver</span>.<span class="ident">recv</span>().<span class="ident">unwrap</span>(); <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="number">1</span>, <span class="ident">msg</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Async%3A%3Ampsc%3A%3Async_channel%3B%0Ause%20std%3A%3Athread%3B%0A%0A%2F%2F%20Create%20a%20rendezvous%20sync_channel%20with%20buffer%20size%200%0Alet%20(sync_sender%2C%20receiver)%20%3D%20sync_channel(0)%3B%0A%0Athread%3A%3Aspawn(move%20%7C%7C%20%7B%0A%20%20%20println!(%22sending%20message...%22)%3B%0A%20%20%20sync_sender.send(1).unwrap()%3B%0A%20%20%20%2F%2F%20Thread%20is%20now%20blocked%20until%20the%20message%20is%20received%0A%0A%20%20%20println!(%22...message%20received!%22)%3B%0A%7D)%3B%0A%0Alet%20msg%20%3D%20receiver.recv().unwrap()%3B%0Aassert_eq!(1%2C%20msg)%3B%0A%7D">Run</a></pre> </div><h4 id='method.try_send' class="method"><span id='try_send.v' class='invisible'><code>pub fn <a href='#method.try_send' class='fnname'>try_send</a>(&self, t: T) -> <a class="enum" href="../../../std/result/enum.Result.html" title="enum std::result::Result">Result</a><<a class="primitive" href="../../primitive.unit.html">()</a>, <a class="enum" href="../../../std/sync/mpsc/enum.TrySendError.html" title="enum std::sync::mpsc::TrySendError">TrySendError</a><T>></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/std/sync/mpsc/mod.rs.html#1031-1033' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>Attempts to send a value on this channel without blocking.</p> <p>This method differs from <a href="../../../std/sync/mpsc/struct.SyncSender.html#method.send"><code>send</code></a> by returning immediately if the channel's buffer is full or no receiver is waiting to acquire some data. Compared with <a href="../../../std/sync/mpsc/struct.SyncSender.html#method.send"><code>send</code></a>, this function has two failure cases instead of one (one for disconnection, one for a full buffer).</p> <p>See <a href="../../../std/sync/mpsc/struct.SyncSender.html#method.send"><code>send</code></a> for notes about guarantees of whether the receiver has received the data or not if this function is successful.</p> <h1 id="examples-2" class="section-header"><a href="#examples-2">Examples</a></h1> <pre class="rust rust-example-rendered"> <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">mpsc</span>::<span class="ident">sync_channel</span>; <span class="kw">use</span> <span class="ident">std</span>::<span class="ident">thread</span>; <span class="comment">// Create a sync_channel with buffer size 1</span> <span class="kw">let</span> (<span class="ident">sync_sender</span>, <span class="ident">receiver</span>) <span class="op">=</span> <span class="ident">sync_channel</span>(<span class="number">1</span>); <span class="kw">let</span> <span class="ident">sync_sender2</span> <span class="op">=</span> <span class="ident">sync_sender</span>.<span class="ident">clone</span>(); <span class="comment">// First thread owns sync_sender</span> <span class="ident">thread</span>::<span class="ident">spawn</span>(<span class="kw">move</span> <span class="op">||</span> { <span class="ident">sync_sender</span>.<span class="ident">send</span>(<span class="number">1</span>).<span class="ident">unwrap</span>(); <span class="ident">sync_sender</span>.<span class="ident">send</span>(<span class="number">2</span>).<span class="ident">unwrap</span>(); <span class="comment">// Thread blocked</span> }); <span class="comment">// Second thread owns sync_sender2</span> <span class="ident">thread</span>::<span class="ident">spawn</span>(<span class="kw">move</span> <span class="op">||</span> { <span class="comment">// This will return an error and send</span> <span class="comment">// no message if the buffer is full</span> <span class="ident">sync_sender2</span>.<span class="ident">try_send</span>(<span class="number">3</span>).<span class="ident">is_err</span>(); }); <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">msg</span>; <span class="ident">msg</span> <span class="op">=</span> <span class="ident">receiver</span>.<span class="ident">recv</span>().<span class="ident">unwrap</span>(); <span class="macro">println</span><span class="macro">!</span>(<span class="string">"message {} received"</span>, <span class="ident">msg</span>); <span class="ident">msg</span> <span class="op">=</span> <span class="ident">receiver</span>.<span class="ident">recv</span>().<span class="ident">unwrap</span>(); <span class="macro">println</span><span class="macro">!</span>(<span class="string">"message {} received"</span>, <span class="ident">msg</span>); <span class="comment">// Third message may have never been sent</span> <span class="kw">match</span> <span class="ident">receiver</span>.<span class="ident">try_recv</span>() { <span class="prelude-val">Ok</span>(<span class="ident">msg</span>) <span class="op">=></span> <span class="macro">println</span><span class="macro">!</span>(<span class="string">"message {} received"</span>, <span class="ident">msg</span>), <span class="prelude-val">Err</span>(_) <span class="op">=></span> <span class="macro">println</span><span class="macro">!</span>(<span class="string">"the third message was never sent"</span>), }<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Async%3A%3Ampsc%3A%3Async_channel%3B%0Ause%20std%3A%3Athread%3B%0A%0A%2F%2F%20Create%20a%20sync_channel%20with%20buffer%20size%201%0Alet%20(sync_sender%2C%20receiver)%20%3D%20sync_channel(1)%3B%0Alet%20sync_sender2%20%3D%20sync_sender.clone()%3B%0A%0A%2F%2F%20First%20thread%20owns%20sync_sender%0Athread%3A%3Aspawn(move%20%7C%7C%20%7B%0A%20%20%20%20sync_sender.send(1).unwrap()%3B%0A%20%20%20%20sync_sender.send(2).unwrap()%3B%0A%20%20%20%20%2F%2F%20Thread%20blocked%0A%7D)%3B%0A%0A%2F%2F%20Second%20thread%20owns%20sync_sender2%0Athread%3A%3Aspawn(move%20%7C%7C%20%7B%0A%20%20%20%20%2F%2F%20This%20will%20return%20an%20error%20and%20send%0A%20%20%20%20%2F%2F%20no%20message%20if%20the%20buffer%20is%20full%0A%20%20%20%20sync_sender2.try_send(3).is_err()%3B%0A%7D)%3B%0A%0Alet%20mut%20msg%3B%0Amsg%20%3D%20receiver.recv().unwrap()%3B%0Aprintln!(%22message%20%7B%7D%20received%22%2C%20msg)%3B%0A%0Amsg%20%3D%20receiver.recv().unwrap()%3B%0Aprintln!(%22message%20%7B%7D%20received%22%2C%20msg)%3B%0A%0A%2F%2F%20Third%20message%20may%20have%20never%20been%20sent%0Amatch%20receiver.try_recv()%20%7B%0A%20%20%20%20Ok(msg)%20%3D%3E%20println!(%22message%20%7B%7D%20received%22%2C%20msg)%2C%0A%20%20%20%20Err(_)%20%3D%3E%20println!(%22the%20third%20message%20was%20never%20sent%22)%2C%0A%7D%0A%7D">Run</a></pre> </div></div> <h2 id='implementations' class='small-section-header'> Trait Implementations<a href='#implementations' class='anchor'></a> </h2> <h3 id='impl-Send' class='impl'><span class='in-band'><code>impl<T: <a class="trait" href="../../../std/marker/trait.Send.html" title="trait std::marker::Send">Send</a>> <a class="trait" href="../../../std/marker/trait.Send.html" title="trait std::marker::Send">Send</a> for <a class="struct" href="../../../std/sync/mpsc/struct.SyncSender.html" title="struct std::sync::mpsc::SyncSender">SyncSender</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/std/sync/mpsc/mod.rs.html#556' title='goto source code'>[src]</a></span></h3> <div class='impl-items'></div><h3 id='impl-Clone' class='impl'><span class='in-band'><code>impl<T> <a class="trait" href="../../../std/clone/trait.Clone.html" title="trait std::clone::Clone">Clone</a> for <a class="struct" href="../../../std/sync/mpsc/struct.SyncSender.html" title="struct std::sync::mpsc::SyncSender">SyncSender</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/std/sync/mpsc/mod.rs.html#1037-1042' 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='../../../std/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../../../std/sync/mpsc/struct.SyncSender.html" title="struct std::sync::mpsc::SyncSender">SyncSender</a><T></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/std/sync/mpsc/mod.rs.html#1038-1041' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>Returns a copy of the value. <a href="../../../std/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='../../../std/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="../../primitive.reference.html">&</a>Self)</code></span><span class='out-of-band'><div class='ghost'></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="../../../std/clone/trait.Clone.html#method.clone_from">Read more</a></p> </div></div><h3 id='impl-Drop' class='impl'><span class='in-band'><code>impl<T> <a class="trait" href="../../../std/ops/trait.Drop.html" title="trait std::ops::Drop">Drop</a> for <a class="struct" href="../../../std/sync/mpsc/struct.SyncSender.html" title="struct std::sync::mpsc::SyncSender">SyncSender</a><T></code><a href='#impl-Drop' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/std/sync/mpsc/mod.rs.html#1045-1049' title='goto source code'>[src]</a></span></h3> <div class='impl-items'><h4 id='method.drop' class="method"><span id='drop.v' class='invisible'><code>fn <a href='../../../std/ops/trait.Drop.html#tymethod.drop' class='fnname'>drop</a>(&mut self)</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/std/sync/mpsc/mod.rs.html#1046-1048' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>Executes the destructor for this type. <a href="../../../std/ops/trait.Drop.html#tymethod.drop">Read more</a></p> </div></div><h3 id='impl-Debug' class='impl'><span class='in-band'><code>impl<T> <a class="trait" href="../../../std/fmt/trait.Debug.html" title="trait std::fmt::Debug">Debug</a> for <a class="struct" href="../../../std/sync/mpsc/struct.SyncSender.html" title="struct std::sync::mpsc::SyncSender">SyncSender</a><T></code><a href='#impl-Debug' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.8.0'>1.8.0</div><a class='srclink' href='../../../src/std/sync/mpsc/mod.rs.html#1052-1056' 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='../../../std/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="../../../std/fmt/struct.Formatter.html" title="struct std::fmt::Formatter">Formatter</a>) -> <a class="type" href="../../../std/fmt/type.Result.html" title="type std::fmt::Result">Result</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/std/sync/mpsc/mod.rs.html#1053-1055' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>Formats the value using the given formatter. <a href="../../../std/fmt/trait.Debug.html#tymethod.fmt">Read more</a></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 = "std"; </script> <script src="../../../main.js"></script> <script defer src="../../../search-index.js"></script> </body> </html>