blob: f5237cb11b53e248bba4a5fec8015f71cecd7762 [file] [log] [blame]
<!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="The sending side of a channel."><meta name="keywords" content="rust, rustlang, rust-lang, Sender"><title>Sender in crossbeam_channel - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../normalize.css"><link rel="stylesheet" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../ayu.css" disabled><link rel="stylesheet" href="../dark.css" disabled><link rel="stylesheet" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../crossbeam_channel/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../crossbeam_channel/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">Sender</a></h2><div class="sidebar-elems"><section><h3><a href="#implementations">Methods</a></h3><ul class="block"><li><a href="#method.capacity">capacity</a></li><li><a href="#method.is_empty">is_empty</a></li><li><a href="#method.is_full">is_full</a></li><li><a href="#method.len">len</a></li><li><a href="#method.same_channel">same_channel</a></li><li><a href="#method.send">send</a></li><li><a href="#method.send_deadline">send_deadline</a></li><li><a href="#method.send_timeout">send_timeout</a></li><li><a href="#method.try_send">try_send</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block"><li><a href="#impl-Clone-for-Sender%3CT%3E">Clone</a></li><li><a href="#impl-Debug-for-Sender%3CT%3E">Debug</a></li><li><a href="#impl-Drop-for-Sender%3CT%3E">Drop</a></li><li><a href="#impl-RefUnwindSafe-for-Sender%3CT%3E">RefUnwindSafe</a></li><li><a href="#impl-Send-for-Sender%3CT%3E">Send</a></li><li><a href="#impl-Sync-for-Sender%3CT%3E">Sync</a></li><li><a href="#impl-UnwindSafe-for-Sender%3CT%3E">UnwindSafe</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block"><li><a href="#impl-Unpin-for-Sender%3CT%3E">Unpin</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block"><li><a href="#impl-Any-for-Sender%3CT%3E">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-Sender%3CT%3E">Borrow&lt;T&gt;</a></li><li><a href="#impl-BorrowMut%3CT%3E-for-Sender%3CT%3E">BorrowMut&lt;T&gt;</a></li><li><a href="#impl-From%3CT%3E-for-Sender%3CT%3E">From&lt;T&gt;</a></li><li><a href="#impl-Into%3CU%3E-for-Sender%3CT%3E">Into&lt;U&gt;</a></li><li><a href="#impl-ToOwned-for-Sender%3CT%3E">ToOwned</a></li><li><a href="#impl-TryFrom%3CU%3E-for-Sender%3CT%3E">TryFrom&lt;U&gt;</a></li><li><a href="#impl-TryInto%3CU%3E-for-Sender%3CT%3E">TryInto&lt;U&gt;</a></li></ul></section><h2><a href="index.html">In crossbeam_channel</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn">Struct <a href="index.html">crossbeam_channel</a>::<wbr><a class="struct" href="#">Sender</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="srclink" href="../src/crossbeam_channel/channel.rs.html#355-357">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="item-decl"><pre class="rust struct"><code>pub struct Sender&lt;T&gt; { /* private fields */ }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The sending side of a channel.</p>
<h2 id="examples"><a href="#examples">Examples</a></h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::thread;
<span class="kw">use </span>crossbeam_channel::unbounded;
<span class="kw">let </span>(s1, r) = unbounded();
<span class="kw">let </span>s2 = s1.clone();
thread::spawn(<span class="kw">move </span>|| s1.send(<span class="number">1</span>).unwrap());
thread::spawn(<span class="kw">move </span>|| s2.send(<span class="number">2</span>).unwrap());
<span class="kw">let </span>msg1 = r.recv().unwrap();
<span class="kw">let </span>msg2 = r.recv().unwrap();
<span class="macro">assert_eq!</span>(msg1 + msg2, <span class="number">3</span>);</code></pre></div>
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Sender%3CT%3E" class="impl has-srclink"><a class="srclink rightside" href="../src/crossbeam_channel/channel.rs.html#377-653">source</a><a href="#impl-Sender%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; <a class="struct" href="struct.Sender.html" title="struct crossbeam_channel::Sender">Sender</a>&lt;T&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_send" class="method has-srclink"><a class="srclink rightside" href="../src/crossbeam_channel/channel.rs.html#399-405">source</a><h4 class="code-header">pub fn <a href="#method.try_send" class="fnname">try_send</a>(&amp;self, msg: T) -&gt; Result&lt;(), <a class="enum" href="enum.TrySendError.html" title="enum crossbeam_channel::TrySendError">TrySendError</a>&lt;T&gt;&gt;</h4></section></summary><div class="docblock"><p>Attempts to send a message into the channel without blocking.</p>
<p>This method will either send a message into the channel immediately or return an error if
the channel is full or disconnected. The returned error contains the original message.</p>
<p>If called on a zero-capacity channel, this method will send the message only if there
happens to be a receive operation on the other side of the channel at the same time.</p>
<h5 id="examples-1"><a href="#examples-1">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_channel::{bounded, TrySendError};
<span class="kw">let </span>(s, r) = bounded(<span class="number">1</span>);
<span class="macro">assert_eq!</span>(s.try_send(<span class="number">1</span>), <span class="prelude-val">Ok</span>(()));
<span class="macro">assert_eq!</span>(s.try_send(<span class="number">2</span>), <span class="prelude-val">Err</span>(TrySendError::Full(<span class="number">2</span>)));
drop(r);
<span class="macro">assert_eq!</span>(s.try_send(<span class="number">3</span>), <span class="prelude-val">Err</span>(TrySendError::Disconnected(<span class="number">3</span>)));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.send" class="method has-srclink"><a class="srclink rightside" href="../src/crossbeam_channel/channel.rs.html#435-445">source</a><h4 class="code-header">pub fn <a href="#method.send" class="fnname">send</a>(&amp;self, msg: T) -&gt; Result&lt;(), <a class="struct" href="struct.SendError.html" title="struct crossbeam_channel::SendError">SendError</a>&lt;T&gt;&gt;</h4></section></summary><div class="docblock"><p>Blocks the current thread until a message is sent or the channel is disconnected.</p>
<p>If the channel is full and not disconnected, this call will block until the send operation
can proceed. If the channel becomes disconnected, this call will wake up and return an
error. The returned error contains the original message.</p>
<p>If called on a zero-capacity channel, this method will wait for a receive operation to
appear on the other side of the channel.</p>
<h5 id="examples-2"><a href="#examples-2">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::thread;
<span class="kw">use </span>std::time::Duration;
<span class="kw">use </span>crossbeam_channel::{bounded, SendError};
<span class="kw">let </span>(s, r) = bounded(<span class="number">1</span>);
<span class="macro">assert_eq!</span>(s.send(<span class="number">1</span>), <span class="prelude-val">Ok</span>(()));
thread::spawn(<span class="kw">move </span>|| {
<span class="macro">assert_eq!</span>(r.recv(), <span class="prelude-val">Ok</span>(<span class="number">1</span>));
thread::sleep(Duration::from_secs(<span class="number">1</span>));
drop(r);
});
<span class="macro">assert_eq!</span>(s.send(<span class="number">2</span>), <span class="prelude-val">Ok</span>(()));
<span class="macro">assert_eq!</span>(s.send(<span class="number">3</span>), <span class="prelude-val">Err</span>(SendError(<span class="number">3</span>)));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.send_timeout" class="method has-srclink"><a class="srclink rightside" href="../src/crossbeam_channel/channel.rs.html#484-489">source</a><h4 class="code-header">pub fn <a href="#method.send_timeout" class="fnname">send_timeout</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self,<br>&nbsp;&nbsp;&nbsp;&nbsp;msg: T,<br>&nbsp;&nbsp;&nbsp;&nbsp;timeout: Duration<br>) -&gt; Result&lt;(), <a class="enum" href="enum.SendTimeoutError.html" title="enum crossbeam_channel::SendTimeoutError">SendTimeoutError</a>&lt;T&gt;&gt;</h4></section></summary><div class="docblock"><p>Waits for a message to be sent into the channel, but only for a limited time.</p>
<p>If the channel is full and not disconnected, this call will block until the send operation
can proceed or the operation times out. If the channel becomes disconnected, this call will
wake up and return an error. The returned error contains the original message.</p>
<p>If called on a zero-capacity channel, this method will wait for a receive operation to
appear on the other side of the channel.</p>
<h5 id="examples-3"><a href="#examples-3">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::thread;
<span class="kw">use </span>std::time::Duration;
<span class="kw">use </span>crossbeam_channel::{bounded, SendTimeoutError};
<span class="kw">let </span>(s, r) = bounded(<span class="number">0</span>);
thread::spawn(<span class="kw">move </span>|| {
thread::sleep(Duration::from_secs(<span class="number">1</span>));
<span class="macro">assert_eq!</span>(r.recv(), <span class="prelude-val">Ok</span>(<span class="number">2</span>));
drop(r);
});
<span class="macro">assert_eq!</span>(
s.send_timeout(<span class="number">1</span>, Duration::from_millis(<span class="number">500</span>)),
<span class="prelude-val">Err</span>(SendTimeoutError::Timeout(<span class="number">1</span>)),
);
<span class="macro">assert_eq!</span>(
s.send_timeout(<span class="number">2</span>, Duration::from_secs(<span class="number">1</span>)),
<span class="prelude-val">Ok</span>(()),
);
<span class="macro">assert_eq!</span>(
s.send_timeout(<span class="number">3</span>, Duration::from_millis(<span class="number">500</span>)),
<span class="prelude-val">Err</span>(SendTimeoutError::Disconnected(<span class="number">3</span>)),
);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.send_deadline" class="method has-srclink"><a class="srclink rightside" href="../src/crossbeam_channel/channel.rs.html#530-536">source</a><h4 class="code-header">pub fn <a href="#method.send_deadline" class="fnname">send_deadline</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self,<br>&nbsp;&nbsp;&nbsp;&nbsp;msg: T,<br>&nbsp;&nbsp;&nbsp;&nbsp;deadline: Instant<br>) -&gt; Result&lt;(), <a class="enum" href="enum.SendTimeoutError.html" title="enum crossbeam_channel::SendTimeoutError">SendTimeoutError</a>&lt;T&gt;&gt;</h4></section></summary><div class="docblock"><p>Waits for a message to be sent into the channel, but only until a given deadline.</p>
<p>If the channel is full and not disconnected, this call will block until the send operation
can proceed or the operation times out. If the channel becomes disconnected, this call will
wake up and return an error. The returned error contains the original message.</p>
<p>If called on a zero-capacity channel, this method will wait for a receive operation to
appear on the other side of the channel.</p>
<h5 id="examples-4"><a href="#examples-4">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::thread;
<span class="kw">use </span>std::time::{Duration, Instant};
<span class="kw">use </span>crossbeam_channel::{bounded, SendTimeoutError};
<span class="kw">let </span>(s, r) = bounded(<span class="number">0</span>);
thread::spawn(<span class="kw">move </span>|| {
thread::sleep(Duration::from_secs(<span class="number">1</span>));
<span class="macro">assert_eq!</span>(r.recv(), <span class="prelude-val">Ok</span>(<span class="number">2</span>));
drop(r);
});
<span class="kw">let </span>now = Instant::now();
<span class="macro">assert_eq!</span>(
s.send_deadline(<span class="number">1</span>, now + Duration::from_millis(<span class="number">500</span>)),
<span class="prelude-val">Err</span>(SendTimeoutError::Timeout(<span class="number">1</span>)),
);
<span class="macro">assert_eq!</span>(
s.send_deadline(<span class="number">2</span>, now + Duration::from_millis(<span class="number">1500</span>)),
<span class="prelude-val">Ok</span>(()),
);
<span class="macro">assert_eq!</span>(
s.send_deadline(<span class="number">3</span>, now + Duration::from_millis(<span class="number">2000</span>)),
<span class="prelude-val">Err</span>(SendTimeoutError::Disconnected(<span class="number">3</span>)),
);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.is_empty" class="method has-srclink"><a class="srclink rightside" href="../src/crossbeam_channel/channel.rs.html#553-559">source</a><h4 class="code-header">pub fn <a href="#method.is_empty" class="fnname">is_empty</a>(&amp;self) -&gt; bool</h4></section></summary><div class="docblock"><p>Returns <code>true</code> if the channel is empty.</p>
<p>Note: Zero-capacity channels are always empty.</p>
<h5 id="examples-5"><a href="#examples-5">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_channel::unbounded;
<span class="kw">let </span>(s, r) = unbounded();
<span class="macro">assert!</span>(s.is_empty());
s.send(<span class="number">0</span>).unwrap();
<span class="macro">assert!</span>(!s.is_empty());</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.is_full" class="method has-srclink"><a class="srclink rightside" href="../src/crossbeam_channel/channel.rs.html#576-582">source</a><h4 class="code-header">pub fn <a href="#method.is_full" class="fnname">is_full</a>(&amp;self) -&gt; bool</h4></section></summary><div class="docblock"><p>Returns <code>true</code> if the channel is full.</p>
<p>Note: Zero-capacity channels are always full.</p>
<h5 id="examples-6"><a href="#examples-6">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_channel::bounded;
<span class="kw">let </span>(s, r) = bounded(<span class="number">1</span>);
<span class="macro">assert!</span>(!s.is_full());
s.send(<span class="number">0</span>).unwrap();
<span class="macro">assert!</span>(s.is_full());</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.len" class="method has-srclink"><a class="srclink rightside" href="../src/crossbeam_channel/channel.rs.html#598-604">source</a><h4 class="code-header">pub fn <a href="#method.len" class="fnname">len</a>(&amp;self) -&gt; usize</h4></section></summary><div class="docblock"><p>Returns the number of messages in the channel.</p>
<h5 id="examples-7"><a href="#examples-7">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_channel::unbounded;
<span class="kw">let </span>(s, r) = unbounded();
<span class="macro">assert_eq!</span>(s.len(), <span class="number">0</span>);
s.send(<span class="number">1</span>).unwrap();
s.send(<span class="number">2</span>).unwrap();
<span class="macro">assert_eq!</span>(s.len(), <span class="number">2</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.capacity" class="method has-srclink"><a class="srclink rightside" href="../src/crossbeam_channel/channel.rs.html#622-628">source</a><h4 class="code-header">pub fn <a href="#method.capacity" class="fnname">capacity</a>(&amp;self) -&gt; Option&lt;usize&gt;</h4></section></summary><div class="docblock"><p>If the channel is bounded, returns its capacity.</p>
<h5 id="examples-8"><a href="#examples-8">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_channel::{bounded, unbounded};
<span class="kw">let </span>(s, <span class="kw">_</span>) = unbounded::&lt;i32&gt;();
<span class="macro">assert_eq!</span>(s.capacity(), <span class="prelude-val">None</span>);
<span class="kw">let </span>(s, <span class="kw">_</span>) = bounded::&lt;i32&gt;(<span class="number">5</span>);
<span class="macro">assert_eq!</span>(s.capacity(), <span class="prelude-val">Some</span>(<span class="number">5</span>));
<span class="kw">let </span>(s, <span class="kw">_</span>) = bounded::&lt;i32&gt;(<span class="number">0</span>);
<span class="macro">assert_eq!</span>(s.capacity(), <span class="prelude-val">Some</span>(<span class="number">0</span>));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.same_channel" class="method has-srclink"><a class="srclink rightside" href="../src/crossbeam_channel/channel.rs.html#645-652">source</a><h4 class="code-header">pub fn <a href="#method.same_channel" class="fnname">same_channel</a>(&amp;self, other: &amp;<a class="struct" href="struct.Sender.html" title="struct crossbeam_channel::Sender">Sender</a>&lt;T&gt;) -&gt; bool</h4></section></summary><div class="docblock"><p>Returns <code>true</code> if senders belong to the same channel.</p>
<h5 id="examples-9"><a href="#examples-9">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_channel::unbounded;
<span class="kw">let </span>(s, <span class="kw">_</span>) = unbounded::&lt;usize&gt;();
<span class="kw">let </span>s2 = s.clone();
<span class="macro">assert!</span>(s.same_channel(<span class="kw-2">&amp;</span>s2));
<span class="kw">let </span>(s3, <span class="kw">_</span>) = unbounded();
<span class="macro">assert!</span>(!s.same_channel(<span class="kw-2">&amp;</span>s3));</code></pre></div>
</div></details></div></details></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Clone-for-Sender%3CT%3E" class="impl has-srclink"><a class="srclink rightside" href="../src/crossbeam_channel/channel.rs.html#667-677">source</a><a href="#impl-Clone-for-Sender%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; Clone for <a class="struct" href="struct.Sender.html" title="struct crossbeam_channel::Sender">Sender</a>&lt;T&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl has-srclink"><a class="srclink rightside" href="../src/crossbeam_channel/channel.rs.html#668-676">source</a><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a class="fnname">clone</a>(&amp;self) -&gt; Self</h4></section></summary><div class='docblock'>Returns a copy of the value. <a>Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl has-srclink"><span class="since rightside" title="Stable since Rust version 1.0.0">1.0.0</span><a href="#method.clone_from" class="anchor"></a><h4 class="code-header">const fn <a class="fnname">clone_from</a>(&amp;mut self, source: &amp;Self)</h4></section></summary><div class='docblock'>Performs copy-assignment from <code>source</code>. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Debug-for-Sender%3CT%3E" class="impl has-srclink"><a class="srclink rightside" href="../src/crossbeam_channel/channel.rs.html#679-683">source</a><a href="#impl-Debug-for-Sender%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; Debug for <a class="struct" href="struct.Sender.html" title="struct crossbeam_channel::Sender">Sender</a>&lt;T&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl has-srclink"><a class="srclink rightside" href="../src/crossbeam_channel/channel.rs.html#680-682">source</a><a href="#method.fmt" class="anchor"></a><h4 class="code-header">fn <a class="fnname">fmt</a>(&amp;self, f: &amp;mut Formatter&lt;'_&gt;) -&gt; Result</h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Drop-for-Sender%3CT%3E" class="impl has-srclink"><a class="srclink rightside" href="../src/crossbeam_channel/channel.rs.html#655-665">source</a><a href="#impl-Drop-for-Sender%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; Drop for <a class="struct" href="struct.Sender.html" title="struct crossbeam_channel::Sender">Sender</a>&lt;T&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.drop" class="method trait-impl has-srclink"><a class="srclink rightside" href="../src/crossbeam_channel/channel.rs.html#656-664">source</a><a href="#method.drop" class="anchor"></a><h4 class="code-header">fn <a class="fnname">drop</a>(&amp;mut self)</h4></section></summary><div class='docblock'>Executes the destructor for this type. <a>Read more</a></div></details></div></details><section id="impl-RefUnwindSafe-for-Sender%3CT%3E" class="impl has-srclink"><a class="srclink rightside" href="../src/crossbeam_channel/channel.rs.html#375">source</a><a href="#impl-RefUnwindSafe-for-Sender%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; RefUnwindSafe for <a class="struct" href="struct.Sender.html" title="struct crossbeam_channel::Sender">Sender</a>&lt;T&gt;</h3></section><section id="impl-Send-for-Sender%3CT%3E" class="impl has-srclink"><a class="srclink rightside" href="../src/crossbeam_channel/channel.rs.html#371">source</a><a href="#impl-Send-for-Sender%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T:&nbsp;Send&gt; Send for <a class="struct" href="struct.Sender.html" title="struct crossbeam_channel::Sender">Sender</a>&lt;T&gt;</h3></section><section id="impl-Sync-for-Sender%3CT%3E" class="impl has-srclink"><a class="srclink rightside" href="../src/crossbeam_channel/channel.rs.html#372">source</a><a href="#impl-Sync-for-Sender%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T:&nbsp;Send&gt; Sync for <a class="struct" href="struct.Sender.html" title="struct crossbeam_channel::Sender">Sender</a>&lt;T&gt;</h3></section><section id="impl-UnwindSafe-for-Sender%3CT%3E" class="impl has-srclink"><a class="srclink rightside" href="../src/crossbeam_channel/channel.rs.html#374">source</a><a href="#impl-UnwindSafe-for-Sender%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; UnwindSafe for <a class="struct" href="struct.Sender.html" title="struct crossbeam_channel::Sender">Sender</a>&lt;T&gt;</h3></section></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"><section id="impl-Unpin-for-Sender%3CT%3E" class="impl has-srclink"><a href="#impl-Unpin-for-Sender%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; Unpin for <a class="struct" href="struct.Sender.html" title="struct crossbeam_channel::Sender">Sender</a>&lt;T&gt;</h3></section></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Any-for-Sender%3CT%3E" class="impl has-srclink"><a href="#impl-Any-for-Sender%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; Any for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?Sized,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><a href="#method.type_id" class="anchor"></a><h4 class="code-header">fn <a class="fnname">type_id</a>(&amp;self) -&gt; TypeId</h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-Sender%3CT%3E" class="impl has-srclink"><a href="#impl-Borrow%3CT%3E-for-Sender%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; Borrow&lt;T&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?Sized,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span><a href="#method.borrow" class="anchor"></a><h4 class="code-header">fn <a class="fnname">borrow</a>(&amp;self) -&gt; &amp;T</h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-Sender%3CT%3E" class="impl has-srclink"><a href="#impl-BorrowMut%3CT%3E-for-Sender%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; BorrowMut&lt;T&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?Sized,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span><a href="#method.borrow_mut" class="anchor"></a><h4 class="code-header">fn <a class="fnname">borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-Sender%3CT%3E" class="impl has-srclink"><a href="#impl-From%3CT%3E-for-Sender%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; From&lt;T&gt; for T</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span><a href="#method.from" class="anchor"></a><h4 class="code-header">fn <a class="fnname">from</a>(t: T) -&gt; T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-Sender%3CT%3E" class="impl has-srclink"><a href="#impl-Into%3CU%3E-for-Sender%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, U&gt; Into&lt;U&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: From&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span><a href="#method.into" class="anchor"></a><h4 class="code-header">fn <a class="fnname">into</a>(self) -&gt; U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
<p>That is, this conversion is whatever the implementation of
<code>[From]&lt;T&gt; for U</code> chooses to do.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-ToOwned-for-Sender%3CT%3E" class="impl has-srclink"><a href="#impl-ToOwned-for-Sender%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; ToOwned for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Clone,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Owned" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Owned" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Owned</a> = T</h4></section></summary><div class='docblock'>The resulting type after obtaining ownership.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.to_owned" class="method trait-impl has-srclink"><a href="#method.to_owned" class="anchor"></a><h4 class="code-header">fn <a class="fnname">to_owned</a>(&amp;self) -&gt; T</h4></section></summary><div class='docblock'>Creates owned data from borrowed data, usually by cloning. <a>Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone_into" class="method trait-impl has-srclink"><a href="#method.clone_into" class="anchor"></a><h4 class="code-header">fn <a class="fnname">clone_into</a>(&amp;self, target: &amp;mut T)</h4></section></summary><div class='docblock'>Uses borrowed data to replace owned data, usually by cloning. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-Sender%3CT%3E" class="impl has-srclink"><a href="#impl-TryFrom%3CU%3E-for-Sender%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, U&gt; TryFrom&lt;U&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: Into&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Error-1" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Error</a> = Infallible</h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span><a href="#method.try_from" class="anchor"></a><h4 class="code-header">fn <a class="fnname">try_from</a>(value: U) -&gt; Result&lt;T, &lt;T as TryFrom&lt;U&gt;&gt;::Error&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-Sender%3CT%3E" class="impl has-srclink"><a href="#impl-TryInto%3CU%3E-for-Sender%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, U&gt; TryInto&lt;U&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: TryFrom&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Error</a> = &lt;U as TryFrom&lt;T&gt;&gt;::Error</h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span><a href="#method.try_into" class="anchor"></a><h4 class="code-header">fn <a class="fnname">try_into</a>(self) -&gt; Result&lt;U, &lt;U as TryFrom&lt;T&gt;&gt;::Error&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="crossbeam_channel" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.66.0-nightly (5c8bff74b 2022-10-21)" ></div></body></html>