<!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="../../../rustdoc.css">
    <link rel="stylesheet" type="text/css" href="../../../main.css">

    <link rel="shortcut icon" href="https://doc.rust-lang.org/favicon.ico">
    
</head>
<body class="rustdoc">
    <!--[if lte IE 8]>
    <div class="warning">
        This old browser is unsupported and will most likely display funky
        things.
    </div>
    <![endif]-->

    

    <nav class="sidebar">
        <a href='../../../std/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='' width='100'></a>
        <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>
    </nav>

    <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 struct">
<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 id='render-detail'>
            <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
                [<span class='inner'>&#x2212;</span>]
            </a>
        </span><a id='src-8944' class='srclink' href='../../../src/std/sync/mpsc/mod.rs.html#333-335' title='goto source code'>[src]</a></span></h1>
<pre class='rust struct'>pub struct SyncSender&lt;T&gt; {
    // some fields omitted
}</pre><div class='docblock'><p>The sending-half of Rust&#39;s synchronous channel type. This half can only be
owned by one thread, but it can be cloned to send to other threads.</p>
</div><h2 id='methods'>Methods</h2><h3 class='impl'><code>impl&lt;T&gt; <a class='struct' href='../../../std/sync/mpsc/struct.SyncSender.html' title='std::sync::mpsc::SyncSender'>SyncSender</a>&lt;T&gt;</code></h3><div class='impl-items'><h4 id='method.send' class='method'><code>fn <a href='#method.send' class='fnname'>send</a>(&amp;self, t: T) -&gt; <a class='enum' href='../../../std/result/enum.Result.html' title='std::result::Result'>Result</a>&lt;<a class='primitive' href='../../primitive.tuple.html'>()</a>, <a class='struct' href='../../../std/sync/mpsc/struct.SendError.html' title='std::sync::mpsc::SendError'>SendError</a>&lt;T&gt;&gt;</code></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, it can be guaranteed that the
receiver has indeed received the data if this function returns success.</p>

<p>This function will never panic, but it may return <code>Err</code> if the
<code>Receiver</code> has disconnected and is no longer able to receive
information.</p>
</div><h4 id='method.try_send' class='method'><code>fn <a href='#method.try_send' class='fnname'>try_send</a>(&amp;self, t: T) -&gt; <a class='enum' href='../../../std/result/enum.Result.html' title='std::result::Result'>Result</a>&lt;<a class='primitive' href='../../primitive.tuple.html'>()</a>, <a class='enum' href='../../../std/sync/mpsc/enum.TrySendError.html' title='std::sync::mpsc::TrySendError'>TrySendError</a>&lt;T&gt;&gt;</code></h4>
<div class='docblock'><p>Attempts to send a value on this channel without blocking.</p>

<p>This method differs from <code>send</code> by returning immediately if the
channel&#39;s buffer is full or no receiver is waiting to acquire some
data. Compared with <code>send</code>, this function has two failure cases
instead of one (one for disconnection, one for a full buffer).</p>

<p>See <code>SyncSender::send</code> for notes about guarantees of whether the
receiver has received the data or not if this function is successful.</p>
</div></div><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><code>impl&lt;T: <a class='trait' href='../../../std/marker/trait.Send.html' title='std::marker::Send'>Send</a>&gt; <a class='trait' href='../../../std/marker/trait.Send.html' title='std::marker::Send'>Send</a> for <a class='struct' href='../../../std/sync/mpsc/struct.SyncSender.html' title='std::sync::mpsc::SyncSender'>SyncSender</a>&lt;T&gt;</code></h3><div class='impl-items'></div><h3 class='impl'><code>impl&lt;T&gt; !<a class='trait' href='../../../std/marker/trait.Sync.html' title='std::marker::Sync'>Sync</a> for <a class='struct' href='../../../std/sync/mpsc/struct.SyncSender.html' title='std::sync::mpsc::SyncSender'>SyncSender</a>&lt;T&gt;</code></h3><div class='impl-items'></div><h3 class='impl'><code>impl&lt;T&gt; <a class='trait' href='../../../std/clone/trait.Clone.html' title='std::clone::Clone'>Clone</a> for <a class='struct' href='../../../std/sync/mpsc/struct.SyncSender.html' title='std::sync::mpsc::SyncSender'>SyncSender</a>&lt;T&gt;</code></h3><div class='impl-items'><h4 id='method.clone' class='method'><code>fn <a href='../../../std/clone/trait.Clone.html#method.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class='struct' href='../../../std/sync/mpsc/struct.SyncSender.html' title='std::sync::mpsc::SyncSender'>SyncSender</a>&lt;T&gt;</code></h4>
<h4 id='method.clone_from' class='method'><code>fn <a href='../../../std/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: &amp;Self)</code></h4>
</div><h3 class='impl'><code>impl&lt;T&gt; <a class='trait' href='../../../std/ops/trait.Drop.html' title='std::ops::Drop'>Drop</a> for <a class='struct' href='../../../std/sync/mpsc/struct.SyncSender.html' title='std::sync::mpsc::SyncSender'>SyncSender</a>&lt;T&gt;</code></h3><div class='impl-items'><h4 id='method.drop' class='method'><code>fn <a href='../../../std/ops/trait.Drop.html#method.drop' class='fnname'>drop</a>(&amp;mut self)</code></h4>
</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>?</dt>
                    <dd>Show this help dialog</dd>
                    <dt>S</dt>
                    <dd>Focus the search field</dd>
                    <dt>&larrb;</dt>
                    <dd>Move up in search results</dd>
                    <dt>&rarrb;</dt>
                    <dd>Move down in search results</dd>
                    <dt>&#9166;</dt>
                    <dd>Go to active search result</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>)
                </p>
            </div>
        </div>
    </aside>

    

    <script>
        window.rootPath = "../../../";
        window.currentCrate = "std";
        window.playgroundUrl = "https://play.rust-lang.org/";
    </script>
    <script src="../../../jquery.js"></script>
    <script src="../../../main.js"></script>
    <script src="../../../playpen.js"></script>
    <script defer src="../../../search-index.js"></script>
</body>
</html>