mirror of
https://github.com/NotAShelf/mpvrc.git
synced 2026-04-17 16:29:50 +00:00
deploy: de38ae62916547ad097c066f94a32e9ba7790eeb
This commit is contained in:
commit
9a86359447
28502 changed files with 1261284 additions and 0 deletions
11
tokio/sync/mpsc/bounded/fn.channel.html
Normal file
11
tokio/sync/mpsc/bounded/fn.channel.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../../tokio/sync/mpsc/fn.channel.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../../tokio/sync/mpsc/fn.channel.html">../../../../tokio/sync/mpsc/fn.channel.html</a>...</p>
|
||||
<script>location.replace("../../../../tokio/sync/mpsc/fn.channel.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
tokio/sync/mpsc/bounded/struct.OwnedPermit.html
Normal file
11
tokio/sync/mpsc/bounded/struct.OwnedPermit.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../../tokio/sync/mpsc/struct.OwnedPermit.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../../tokio/sync/mpsc/struct.OwnedPermit.html">../../../../tokio/sync/mpsc/struct.OwnedPermit.html</a>...</p>
|
||||
<script>location.replace("../../../../tokio/sync/mpsc/struct.OwnedPermit.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
tokio/sync/mpsc/bounded/struct.Permit.html
Normal file
11
tokio/sync/mpsc/bounded/struct.Permit.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../../tokio/sync/mpsc/struct.Permit.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../../tokio/sync/mpsc/struct.Permit.html">../../../../tokio/sync/mpsc/struct.Permit.html</a>...</p>
|
||||
<script>location.replace("../../../../tokio/sync/mpsc/struct.Permit.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
tokio/sync/mpsc/bounded/struct.PermitIterator.html
Normal file
11
tokio/sync/mpsc/bounded/struct.PermitIterator.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../../tokio/sync/mpsc/struct.PermitIterator.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../../tokio/sync/mpsc/struct.PermitIterator.html">../../../../tokio/sync/mpsc/struct.PermitIterator.html</a>...</p>
|
||||
<script>location.replace("../../../../tokio/sync/mpsc/struct.PermitIterator.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
tokio/sync/mpsc/bounded/struct.Receiver.html
Normal file
11
tokio/sync/mpsc/bounded/struct.Receiver.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../../tokio/sync/mpsc/struct.Receiver.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../../tokio/sync/mpsc/struct.Receiver.html">../../../../tokio/sync/mpsc/struct.Receiver.html</a>...</p>
|
||||
<script>location.replace("../../../../tokio/sync/mpsc/struct.Receiver.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
tokio/sync/mpsc/bounded/struct.Sender.html
Normal file
11
tokio/sync/mpsc/bounded/struct.Sender.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../../tokio/sync/mpsc/struct.Sender.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../../tokio/sync/mpsc/struct.Sender.html">../../../../tokio/sync/mpsc/struct.Sender.html</a>...</p>
|
||||
<script>location.replace("../../../../tokio/sync/mpsc/struct.Sender.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
tokio/sync/mpsc/bounded/struct.WeakSender.html
Normal file
11
tokio/sync/mpsc/bounded/struct.WeakSender.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../../tokio/sync/mpsc/struct.WeakSender.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../../tokio/sync/mpsc/struct.WeakSender.html">../../../../tokio/sync/mpsc/struct.WeakSender.html</a>...</p>
|
||||
<script>location.replace("../../../../tokio/sync/mpsc/struct.WeakSender.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
30
tokio/sync/mpsc/error/enum.SendTimeoutError.html
Normal file
30
tokio/sync/mpsc/error/enum.SendTimeoutError.html
Normal file
File diff suppressed because one or more lines are too long
23
tokio/sync/mpsc/error/enum.TryRecvError.html
Normal file
23
tokio/sync/mpsc/error/enum.TryRecvError.html
Normal file
File diff suppressed because one or more lines are too long
31
tokio/sync/mpsc/error/enum.TrySendError.html
Normal file
31
tokio/sync/mpsc/error/enum.TrySendError.html
Normal file
File diff suppressed because one or more lines are too long
3
tokio/sync/mpsc/error/index.html
Normal file
3
tokio/sync/mpsc/error/index.html
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<!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="Channel error types."><title>tokio::sync::mpsc::error - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="tokio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../../../static.files/storage-59e33391.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[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" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module error</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In tokio::<wbr>sync::<wbr>mpsc</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../../../index.html">tokio</a>::<wbr><a href="../../index.html">sync</a>::<wbr><a href="../index.html">mpsc</a></span><h1>Module <span>error</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../src/tokio/sync/mpsc/error.rs.html#1-169">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Channel error types.</p>
|
||||
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.SendError.html" title="struct tokio::sync::mpsc::error::SendError">Send<wbr>Error</a></div><div class="desc docblock-short">Error returned by the <code>Sender</code>.</div></li></ul><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="enum" href="enum.SendTimeoutError.html" title="enum tokio::sync::mpsc::error::SendTimeoutError">Send<wbr>Timeout<wbr>Error</a></div><div class="desc docblock-short">Error returned by <a href="../struct.Sender.html#method.send_timeout" title="method tokio::sync::mpsc::Sender::send_timeout"><code>Sender::send_timeout</code></a>].</div></li><li><div class="item-name"><a class="enum" href="enum.TryRecvError.html" title="enum tokio::sync::mpsc::error::TryRecvError">TryRecv<wbr>Error</a></div><div class="desc docblock-short">Error returned by <code>try_recv</code>.</div></li><li><div class="item-name"><a class="enum" href="enum.TrySendError.html" title="enum tokio::sync::mpsc::error::TrySendError">TrySend<wbr>Error</a></div><div class="desc docblock-short">This enumeration is the list of the possible error outcomes for the
|
||||
<a href="../struct.Sender.html#method.try_send" title="method tokio::sync::mpsc::Sender::try_send"><code>try_send</code></a> method.</div></li></ul></section></div></main></body></html>
|
||||
1
tokio/sync/mpsc/error/sidebar-items.js
Normal file
1
tokio/sync/mpsc/error/sidebar-items.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
window.SIDEBAR_ITEMS = {"enum":["SendTimeoutError","TryRecvError","TrySendError"],"struct":["SendError"]};
|
||||
22
tokio/sync/mpsc/error/struct.SendError.html
Normal file
22
tokio/sync/mpsc/error/struct.SendError.html
Normal file
File diff suppressed because one or more lines are too long
35
tokio/sync/mpsc/fn.channel.html
Normal file
35
tokio/sync/mpsc/fn.channel.html
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<!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="Creates a bounded mpsc channel for communicating between asynchronous tasks with backpressure."><title>channel in tokio::sync::mpsc - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="tokio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[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" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">channel</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#panics" title="Panics">Panics</a></li><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>sync::<wbr>mpsc</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../../index.html">tokio</a>::<wbr><a href="../index.html">sync</a>::<wbr><a href="index.html">mpsc</a></span><h1>Function <span class="fn">channel</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/tokio/sync/mpsc/bounded.rs.html#156-168">Source</a> </span></div><pre class="rust item-decl"><code>pub fn channel<T>(buffer: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.usize.html">usize</a>) -> (<a class="struct" href="struct.Sender.html" title="struct tokio::sync::mpsc::Sender">Sender</a><T>, <a class="struct" href="struct.Receiver.html" title="struct tokio::sync::mpsc::Receiver">Receiver</a><T>)</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates a bounded mpsc channel for communicating between asynchronous tasks
|
||||
with backpressure.</p>
|
||||
<p>The channel will buffer up to the provided number of messages. Once the
|
||||
buffer is full, attempts to send new messages will wait until a message is
|
||||
received from the channel. The provided buffer capacity must be at least 1.</p>
|
||||
<p>All data sent on <code>Sender</code> will become available on <code>Receiver</code> in the same
|
||||
order as it was sent.</p>
|
||||
<p>The <code>Sender</code> can be cloned to <code>send</code> to the same channel from multiple code
|
||||
locations. Only one <code>Receiver</code> is supported.</p>
|
||||
<p>If the <code>Receiver</code> is disconnected while trying to <code>send</code>, the <code>send</code> method
|
||||
will return a <code>SendError</code>. Similarly, if <code>Sender</code> is disconnected while
|
||||
trying to <code>recv</code>, the <code>recv</code> method will return <code>None</code>.</p>
|
||||
<h2 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h2>
|
||||
<p>Panics if the buffer capacity is 0.</p>
|
||||
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::sync::mpsc;
|
||||
|
||||
<span class="attr">#[tokio::main]
|
||||
</span><span class="kw">async fn </span>main() {
|
||||
<span class="kw">let </span>(tx, <span class="kw-2">mut </span>rx) = mpsc::channel(<span class="number">100</span>);
|
||||
|
||||
tokio::spawn(<span class="kw">async move </span>{
|
||||
<span class="kw">for </span>i <span class="kw">in </span><span class="number">0</span>..<span class="number">10 </span>{
|
||||
<span class="kw">if let </span><span class="prelude-val">Err</span>(<span class="kw">_</span>) = tx.send(i).<span class="kw">await </span>{
|
||||
<span class="macro">println!</span>(<span class="string">"receiver dropped"</span>);
|
||||
<span class="kw">return</span>;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<span class="kw">while let </span><span class="prelude-val">Some</span>(i) = rx.recv().<span class="kw">await </span>{
|
||||
<span class="macro">println!</span>(<span class="string">"got = {}"</span>, i);
|
||||
}
|
||||
}</code></pre></div>
|
||||
</div></details></section></div></main></body></html>
|
||||
9
tokio/sync/mpsc/fn.unbounded_channel.html
Normal file
9
tokio/sync/mpsc/fn.unbounded_channel.html
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<!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="Creates an unbounded mpsc channel for communicating between asynchronous tasks without backpressure."><title>unbounded_channel in tokio::sync::mpsc - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="tokio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[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" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>sync::<wbr>mpsc</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../../index.html">tokio</a>::<wbr><a href="../index.html">sync</a>::<wbr><a href="index.html">mpsc</a></span><h1>Function <span class="fn">unbounded_channel</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/tokio/sync/mpsc/unbounded.rs.html#95-102">Source</a> </span></div><pre class="rust item-decl"><code>pub fn unbounded_channel<T>() -> (<a class="struct" href="struct.UnboundedSender.html" title="struct tokio::sync::mpsc::UnboundedSender">UnboundedSender</a><T>, <a class="struct" href="struct.UnboundedReceiver.html" title="struct tokio::sync::mpsc::UnboundedReceiver">UnboundedReceiver</a><T>)</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates an unbounded mpsc channel for communicating between asynchronous
|
||||
tasks without backpressure.</p>
|
||||
<p>A <code>send</code> on this channel will always succeed as long as the receive half has
|
||||
not been closed. If the receiver falls behind, messages will be arbitrarily
|
||||
buffered.</p>
|
||||
<p><strong>Note</strong> that the amount of available system memory is an implicit bound to
|
||||
the channel. Using an <code>unbounded</code> channel has the ability of causing the
|
||||
process to run out of memory. In this case, the process will be aborted.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
78
tokio/sync/mpsc/index.html
Normal file
78
tokio/sync/mpsc/index.html
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
<!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="A multi-producer, single-consumer queue for sending values between asynchronous tasks."><title>tokio::sync::mpsc - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="tokio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../../static.files/storage-59e33391.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[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" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module mpsc</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#disconnection" title="Disconnection">Disconnection</a></li><li><a href="#clean-shutdown" title="Clean Shutdown">Clean Shutdown</a></li><li><a href="#communicating-between-sync-and-async-code" title="Communicating between sync and async code">Communicating between sync and async code</a></li><li><a href="#multiple-runtimes" title="Multiple runtimes">Multiple runtimes</a></li><li><a href="#allocation-behavior" title="Allocation behavior">Allocation behavior</a></li></ul><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In tokio::<wbr>sync</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../../index.html">tokio</a>::<wbr><a href="../index.html">sync</a></span><h1>Module <span>mpsc</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/tokio/sync/mpsc/mod.rs.html#1-144">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A multi-producer, single-consumer queue for sending values between
|
||||
asynchronous tasks.</p>
|
||||
<p>This module provides two variants of the channel: bounded and unbounded. The
|
||||
bounded variant has a limit on the number of messages that the channel can
|
||||
store, and if this limit is reached, trying to send another message will
|
||||
wait until a message is received from the channel. An unbounded channel has
|
||||
an infinite capacity, so the <code>send</code> method will always complete immediately.
|
||||
This makes the <a href="struct.UnboundedSender.html" title="struct tokio::sync::mpsc::UnboundedSender"><code>UnboundedSender</code></a> usable from both synchronous and
|
||||
asynchronous code.</p>
|
||||
<p>Similar to the <code>mpsc</code> channels provided by <code>std</code>, the channel constructor
|
||||
functions provide separate send and receive handles, <a href="struct.Sender.html" title="struct tokio::sync::mpsc::Sender"><code>Sender</code></a> and
|
||||
<a href="struct.Receiver.html" title="struct tokio::sync::mpsc::Receiver"><code>Receiver</code></a> for the bounded channel, <a href="struct.UnboundedSender.html" title="struct tokio::sync::mpsc::UnboundedSender"><code>UnboundedSender</code></a> and
|
||||
<a href="struct.UnboundedReceiver.html" title="struct tokio::sync::mpsc::UnboundedReceiver"><code>UnboundedReceiver</code></a> for the unbounded channel. If there is no message to read,
|
||||
the current task will be notified when a new value is sent. <a href="struct.Sender.html" title="struct tokio::sync::mpsc::Sender"><code>Sender</code></a> and
|
||||
<a href="struct.UnboundedSender.html" title="struct tokio::sync::mpsc::UnboundedSender"><code>UnboundedSender</code></a> allow sending values into the channel. If the bounded
|
||||
channel is at capacity, the send is rejected and the task will be notified
|
||||
when additional capacity is available. In other words, the channel provides
|
||||
backpressure.</p>
|
||||
<p>This channel is also suitable for the single-producer single-consumer
|
||||
use-case. (Unless you only need to send one message, in which case you
|
||||
should use the <a href="../oneshot/index.html" title="mod tokio::sync::oneshot">oneshot</a> channel.)</p>
|
||||
<h2 id="disconnection"><a class="doc-anchor" href="#disconnection">§</a>Disconnection</h2>
|
||||
<p>When all <a href="struct.Sender.html" title="struct tokio::sync::mpsc::Sender"><code>Sender</code></a> handles have been dropped, it is no longer
|
||||
possible to send values into the channel. This is considered the termination
|
||||
event of the stream. As such, <code>Receiver::poll</code> returns <code>Ok(Ready(None))</code>.</p>
|
||||
<p>If the <a href="struct.Receiver.html" title="struct tokio::sync::mpsc::Receiver"><code>Receiver</code></a> handle is dropped, then messages can no longer
|
||||
be read out of the channel. In this case, all further attempts to send will
|
||||
result in an error. Additionally, all unread messages will be drained from the
|
||||
channel and dropped.</p>
|
||||
<h2 id="clean-shutdown"><a class="doc-anchor" href="#clean-shutdown">§</a>Clean Shutdown</h2>
|
||||
<p>When the <a href="struct.Receiver.html" title="struct tokio::sync::mpsc::Receiver"><code>Receiver</code></a> is dropped, it is possible for unprocessed messages to
|
||||
remain in the channel. Instead, it is usually desirable to perform a “clean”
|
||||
shutdown. To do this, the receiver first calls <code>close</code>, which will prevent
|
||||
any further messages to be sent into the channel. Then, the receiver
|
||||
consumes the channel to completion, at which point the receiver can be
|
||||
dropped.</p>
|
||||
<h2 id="communicating-between-sync-and-async-code"><a class="doc-anchor" href="#communicating-between-sync-and-async-code">§</a>Communicating between sync and async code</h2>
|
||||
<p>When you want to communicate between synchronous and asynchronous code, there
|
||||
are two situations to consider:</p>
|
||||
<p><strong>Bounded channel</strong>: If you need a bounded channel, you should use a bounded
|
||||
Tokio <code>mpsc</code> channel for both directions of communication. Instead of calling
|
||||
the async <a href="struct.Sender.html#method.send" title="method tokio::sync::mpsc::Sender::send"><code>send</code></a> or <a href="struct.Receiver.html#method.recv" title="method tokio::sync::mpsc::Receiver::recv"><code>recv</code></a> methods, in
|
||||
synchronous code you will need to use the <a href="struct.Sender.html#method.blocking_send" title="method tokio::sync::mpsc::Sender::blocking_send"><code>blocking_send</code></a> or
|
||||
<a href="struct.Receiver.html#method.blocking_recv" title="method tokio::sync::mpsc::Receiver::blocking_recv"><code>blocking_recv</code></a> methods.</p>
|
||||
<p><strong>Unbounded channel</strong>: You should use the kind of channel that matches where
|
||||
the receiver is. So for sending a message <em>from async to sync</em>, you should
|
||||
use <a href="https://doc.rust-lang.org/1.84.1/std/sync/mpsc/fn.channel.html" title="fn std::sync::mpsc::channel">the standard library unbounded channel</a> or
|
||||
<a href="https://docs.rs/crossbeam/*/crossbeam/channel/fn.unbounded.html">crossbeam</a>. Similarly, for sending a message <em>from sync
|
||||
to async</em>, you should use an unbounded Tokio <code>mpsc</code> channel.</p>
|
||||
<p>Please be aware that the above remarks were written with the <code>mpsc</code> channel
|
||||
in mind, but they can also be generalized to other kinds of channels. In
|
||||
general, any channel method that isn’t marked async can be called anywhere,
|
||||
including outside of the runtime. For example, sending a message on a
|
||||
<a href="../oneshot/index.html" title="mod tokio::sync::oneshot">oneshot</a> channel from outside the runtime is perfectly fine.</p>
|
||||
<h2 id="multiple-runtimes"><a class="doc-anchor" href="#multiple-runtimes">§</a>Multiple runtimes</h2>
|
||||
<p>The <code>mpsc</code> channel is runtime agnostic. You can freely move it between
|
||||
different instances of the Tokio runtime or even use it from non-Tokio
|
||||
runtimes.</p>
|
||||
<p>When used in a Tokio runtime, it participates in
|
||||
<a href="../../task/index.html#cooperative-scheduling" title="mod tokio::task">cooperative scheduling</a> to avoid
|
||||
starvation. This feature does not apply when used from non-Tokio runtimes.</p>
|
||||
<p>As an exception, methods ending in <code>_timeout</code> are not runtime agnostic
|
||||
because they require access to the Tokio timer. See the documentation of
|
||||
each <code>*_timeout</code> method for more information on its use.</p>
|
||||
<h2 id="allocation-behavior"><a class="doc-anchor" href="#allocation-behavior">§</a>Allocation behavior</h2><div class="warning">The implementation details described in this section may change in future
|
||||
Tokio releases.</div>
|
||||
<p>The mpsc channel stores elements in blocks. Blocks are organized in a linked list. Sending
|
||||
pushes new elements onto the block at the front of the list, and receiving pops them off the
|
||||
one at the back. A block can hold 32 messages on a 64-bit target and 16 messages on a 32-bit
|
||||
target. This number is independent of channel and message size. Each block also stores 4
|
||||
pointer-sized values for bookkeeping (so on a 64-bit machine, each message has 1 byte of
|
||||
overhead).</p>
|
||||
<p>When all values in a block have been received, it becomes empty. It will then be freed, unless
|
||||
the channel’s first block (where newly-sent elements are being stored) has no next block. In
|
||||
that case, the empty block is reused as the next block.</p>
|
||||
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="mod" href="error/index.html" title="mod tokio::sync::mpsc::error">error</a></div><div class="desc docblock-short">Channel error types.</div></li></ul><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.OwnedPermit.html" title="struct tokio::sync::mpsc::OwnedPermit">Owned<wbr>Permit</a></div><div class="desc docblock-short">Owned permit to send one value into the channel.</div></li><li><div class="item-name"><a class="struct" href="struct.Permit.html" title="struct tokio::sync::mpsc::Permit">Permit</a></div><div class="desc docblock-short">Permits to send one value into the channel.</div></li><li><div class="item-name"><a class="struct" href="struct.PermitIterator.html" title="struct tokio::sync::mpsc::PermitIterator">Permit<wbr>Iterator</a></div><div class="desc docblock-short">An <a href="https://doc.rust-lang.org/1.84.1/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator"><code>Iterator</code></a> of <a href="struct.Permit.html" title="struct tokio::sync::mpsc::Permit"><code>Permit</code></a> that can be used to hold <code>n</code> slots in the channel.</div></li><li><div class="item-name"><a class="struct" href="struct.Receiver.html" title="struct tokio::sync::mpsc::Receiver">Receiver</a></div><div class="desc docblock-short">Receives values from the associated <code>Sender</code>.</div></li><li><div class="item-name"><a class="struct" href="struct.Sender.html" title="struct tokio::sync::mpsc::Sender">Sender</a></div><div class="desc docblock-short">Sends values to the associated <code>Receiver</code>.</div></li><li><div class="item-name"><a class="struct" href="struct.UnboundedReceiver.html" title="struct tokio::sync::mpsc::UnboundedReceiver">Unbounded<wbr>Receiver</a></div><div class="desc docblock-short">Receive values from the associated <code>UnboundedSender</code>.</div></li><li><div class="item-name"><a class="struct" href="struct.UnboundedSender.html" title="struct tokio::sync::mpsc::UnboundedSender">Unbounded<wbr>Sender</a></div><div class="desc docblock-short">Send values to the associated <code>UnboundedReceiver</code>.</div></li><li><div class="item-name"><a class="struct" href="struct.WeakSender.html" title="struct tokio::sync::mpsc::WeakSender">Weak<wbr>Sender</a></div><div class="desc docblock-short">A sender that does not prevent the channel from being closed.</div></li><li><div class="item-name"><a class="struct" href="struct.WeakUnboundedSender.html" title="struct tokio::sync::mpsc::WeakUnboundedSender">Weak<wbr>Unbounded<wbr>Sender</a></div><div class="desc docblock-short">An unbounded sender that does not prevent the channel from being closed.</div></li></ul><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="fn" href="fn.channel.html" title="fn tokio::sync::mpsc::channel">channel</a></div><div class="desc docblock-short">Creates a bounded mpsc channel for communicating between asynchronous tasks
|
||||
with backpressure.</div></li><li><div class="item-name"><a class="fn" href="fn.unbounded_channel.html" title="fn tokio::sync::mpsc::unbounded_channel">unbounded_<wbr>channel</a></div><div class="desc docblock-short">Creates an unbounded mpsc channel for communicating between asynchronous
|
||||
tasks without backpressure.</div></li></ul></section></div></main></body></html>
|
||||
1
tokio/sync/mpsc/sidebar-items.js
Normal file
1
tokio/sync/mpsc/sidebar-items.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
window.SIDEBAR_ITEMS = {"fn":["channel","unbounded_channel"],"mod":["error"],"struct":["OwnedPermit","Permit","PermitIterator","Receiver","Sender","UnboundedReceiver","UnboundedSender","WeakSender","WeakUnboundedSender"]};
|
||||
68
tokio/sync/mpsc/struct.OwnedPermit.html
Normal file
68
tokio/sync/mpsc/struct.OwnedPermit.html
Normal file
File diff suppressed because one or more lines are too long
41
tokio/sync/mpsc/struct.Permit.html
Normal file
41
tokio/sync/mpsc/struct.Permit.html
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<!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="Permits to send one value into the channel."><title>Permit in tokio::sync::mpsc - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="tokio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.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" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Permit</a></h2><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.send" title="send">send</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Debug-for-Permit%3C'_,+T%3E" title="Debug">Debug</a></li><li><a href="#impl-Drop-for-Permit%3C'_,+T%3E" title="Drop">Drop</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Freeze-for-Permit%3C'a,+T%3E" title="Freeze">Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-Permit%3C'a,+T%3E" title="RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send-for-Permit%3C'a,+T%3E" title="Send">Send</a></li><li><a href="#impl-Sync-for-Permit%3C'a,+T%3E" title="Sync">Sync</a></li><li><a href="#impl-Unpin-for-Permit%3C'a,+T%3E" title="Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe-for-Permit%3C'a,+T%3E" title="UnwindSafe">UnwindSafe</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T" title="Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T" title="Borrow<T>">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T" title="BorrowMut<T>">BorrowMut<T></a></li><li><a href="#impl-From%3CT%3E-for-T" title="From<T>">From<T></a></li><li><a href="#impl-Into%3CU%3E-for-T" title="Into<U>">Into<U></a></li><li><a href="#impl-TryFrom%3CU%3E-for-T" title="TryFrom<U>">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E-for-T" title="TryInto<U>">TryInto<U></a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>sync::<wbr>mpsc</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../../index.html">tokio</a>::<wbr><a href="../index.html">sync</a>::<wbr><a href="index.html">mpsc</a></span><h1>Struct <span class="struct">Permit</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/tokio/sync/mpsc/bounded.rs.html#67-69">Source</a> </span></div><pre class="rust item-decl"><code>pub struct Permit<'a, T> { <span class="comment">/* private fields */</span> }</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Permits to send one value into the channel.</p>
|
||||
<p><code>Permit</code> values are returned by <a href="struct.Sender.html#method.reserve" title="method tokio::sync::mpsc::Sender::reserve"><code>Sender::reserve()</code></a> and <a href="struct.Sender.html#method.try_reserve" title="method tokio::sync::mpsc::Sender::try_reserve"><code>Sender::try_reserve()</code></a>
|
||||
and are used to guarantee channel capacity before generating a message to send.</p>
|
||||
</div></details><h2 id="implementations" class="section-header">Implementations<a href="#implementations" class="anchor">§</a></h2><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Permit%3C'_,+T%3E" class="impl"><a class="src rightside" href="../../../src/tokio/sync/mpsc/bounded.rs.html#1650-1691">Source</a><a href="#impl-Permit%3C'_,+T%3E" class="anchor">§</a><h3 class="code-header">impl<T> <a class="struct" href="struct.Permit.html" title="struct tokio::sync::mpsc::Permit">Permit</a><'_, T></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.send" class="method"><a class="src rightside" href="../../../src/tokio/sync/mpsc/bounded.rs.html#1683-1690">Source</a><h4 class="code-header">pub fn <a href="#method.send" class="fn">send</a>(self, value: T)</h4></section></summary><div class="docblock"><p>Sends a value using the reserved capacity.</p>
|
||||
<p>Capacity for the message has already been reserved. The message is sent
|
||||
to the receiver and the permit is consumed. The operation will succeed
|
||||
even if the receiver half has been closed. See <a href="struct.Receiver.html#method.close" title="method tokio::sync::mpsc::Receiver::close"><code>Receiver::close</code></a> for
|
||||
more details on performing a clean shutdown.</p>
|
||||
<h5 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h5>
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::sync::mpsc;
|
||||
|
||||
<span class="attr">#[tokio::main]
|
||||
</span><span class="kw">async fn </span>main() {
|
||||
<span class="kw">let </span>(tx, <span class="kw-2">mut </span>rx) = mpsc::channel(<span class="number">1</span>);
|
||||
|
||||
<span class="comment">// Reserve capacity
|
||||
</span><span class="kw">let </span>permit = tx.reserve().<span class="kw">await</span>.unwrap();
|
||||
|
||||
<span class="comment">// Trying to send directly on the `tx` will fail due to no
|
||||
// available capacity.
|
||||
</span><span class="macro">assert!</span>(tx.try_send(<span class="number">123</span>).is_err());
|
||||
|
||||
<span class="comment">// Send a message on the permit
|
||||
</span>permit.send(<span class="number">456</span>);
|
||||
|
||||
<span class="comment">// The value sent on the permit is received
|
||||
</span><span class="macro">assert_eq!</span>(rx.recv().<span class="kw">await</span>.unwrap(), <span class="number">456</span>);
|
||||
}</code></pre></div>
|
||||
</div></details></div></details></div><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Debug-for-Permit%3C'_,+T%3E" class="impl"><a class="src rightside" href="../../../src/tokio/sync/mpsc/bounded.rs.html#1710-1716">Source</a><a href="#impl-Debug-for-Permit%3C'_,+T%3E" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.Permit.html" title="struct tokio::sync::mpsc::Permit">Permit</a><'_, T></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl"><a class="src rightside" href="../../../src/tokio/sync/mpsc/bounded.rs.html#1711-1715">Source</a><a href="#method.fmt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Debug.html#tymethod.fmt" class="fn">fmt</a>(&self, fmt: &mut <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/1.84.1/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Drop-for-Permit%3C'_,+T%3E" class="impl"><a class="src rightside" href="../../../src/tokio/sync/mpsc/bounded.rs.html#1693-1708">Source</a><a href="#impl-Drop-for-Permit%3C'_,+T%3E" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="struct.Permit.html" title="struct tokio::sync::mpsc::Permit">Permit</a><'_, T></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.drop" class="method trait-impl"><a class="src rightside" href="../../../src/tokio/sync/mpsc/bounded.rs.html#1694-1707">Source</a><a href="#method.drop" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/ops/drop/trait.Drop.html#tymethod.drop" class="fn">drop</a>(&mut self)</h4></section></summary><div class='docblock'>Executes the destructor for this type. <a href="https://doc.rust-lang.org/1.84.1/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></div></details></div></details></div><h2 id="synthetic-implementations" class="section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor">§</a></h2><div id="synthetic-implementations-list"><section id="impl-Freeze-for-Permit%3C'a,+T%3E" class="impl"><a href="#impl-Freeze-for-Permit%3C'a,+T%3E" class="anchor">§</a><h3 class="code-header">impl<'a, T> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="struct" href="struct.Permit.html" title="struct tokio::sync::mpsc::Permit">Permit</a><'a, T></h3></section><section id="impl-RefUnwindSafe-for-Permit%3C'a,+T%3E" class="impl"><a href="#impl-RefUnwindSafe-for-Permit%3C'a,+T%3E" class="anchor">§</a><h3 class="code-header">impl<'a, T> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.Permit.html" title="struct tokio::sync::mpsc::Permit">Permit</a><'a, T></h3></section><section id="impl-Send-for-Permit%3C'a,+T%3E" class="impl"><a href="#impl-Send-for-Permit%3C'a,+T%3E" class="anchor">§</a><h3 class="code-header">impl<'a, T> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.Permit.html" title="struct tokio::sync::mpsc::Permit">Permit</a><'a, T><div class="where">where
|
||||
T: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,</div></h3></section><section id="impl-Sync-for-Permit%3C'a,+T%3E" class="impl"><a href="#impl-Sync-for-Permit%3C'a,+T%3E" class="anchor">§</a><h3 class="code-header">impl<'a, T> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.Permit.html" title="struct tokio::sync::mpsc::Permit">Permit</a><'a, T><div class="where">where
|
||||
T: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,</div></h3></section><section id="impl-Unpin-for-Permit%3C'a,+T%3E" class="impl"><a href="#impl-Unpin-for-Permit%3C'a,+T%3E" class="anchor">§</a><h3 class="code-header">impl<'a, T> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.Permit.html" title="struct tokio::sync::mpsc::Permit">Permit</a><'a, T></h3></section><section id="impl-UnwindSafe-for-Permit%3C'a,+T%3E" class="impl"><a href="#impl-UnwindSafe-for-Permit%3C'a,+T%3E" class="anchor">§</a><h3 class="code-header">impl<'a, T> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.Permit.html" title="struct tokio::sync::mpsc::Permit">Permit</a><'a, T></h3></section></div><h2 id="blanket-implementations" class="section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor">§</a></h2><div id="blanket-implementations-list"><details class="toggle implementors-toggle"><summary><section id="impl-Any-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/any.rs.html#138">Source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<div class="where">where
|
||||
T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/any.rs.html#139">Source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.84.1/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/borrow.rs.html#209">Source</a><a href="#impl-Borrow%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T<div class="where">where
|
||||
T: ?<a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/borrow.rs.html#211">Source</a><a href="#method.borrow" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&T</a></h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/borrow.rs.html#217">Source</a><a href="#impl-BorrowMut%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T<div class="where">where
|
||||
T: ?<a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/borrow.rs.html#218">Source</a><a href="#method.borrow_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fn">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&mut T</a></h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#765">Source</a><a href="#impl-From%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#768">Source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
||||
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#748-750">Source</a><a href="#impl-Into%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T<div class="where">where
|
||||
U: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#758">Source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.Into.html#tymethod.into" class="fn">into</a>(self) -> 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><a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for U</code> chooses to do.</p>
|
||||
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#805-807">Source</a><a href="#impl-TryFrom%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T<div class="where">where
|
||||
U: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#809">Source</a><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#812">Source</a><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#790-792">Source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T<div class="where">where
|
||||
U: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#794">Source</a><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#797">Source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div></section></div></main></body></html>
|
||||
192
tokio/sync/mpsc/struct.PermitIterator.html
Normal file
192
tokio/sync/mpsc/struct.PermitIterator.html
Normal file
File diff suppressed because one or more lines are too long
401
tokio/sync/mpsc/struct.Receiver.html
Normal file
401
tokio/sync/mpsc/struct.Receiver.html
Normal file
File diff suppressed because one or more lines are too long
554
tokio/sync/mpsc/struct.Sender.html
Normal file
554
tokio/sync/mpsc/struct.Sender.html
Normal file
File diff suppressed because one or more lines are too long
296
tokio/sync/mpsc/struct.UnboundedReceiver.html
Normal file
296
tokio/sync/mpsc/struct.UnboundedReceiver.html
Normal file
File diff suppressed because one or more lines are too long
79
tokio/sync/mpsc/struct.UnboundedSender.html
Normal file
79
tokio/sync/mpsc/struct.UnboundedSender.html
Normal file
File diff suppressed because one or more lines are too long
41
tokio/sync/mpsc/struct.WeakSender.html
Normal file
41
tokio/sync/mpsc/struct.WeakSender.html
Normal file
File diff suppressed because one or more lines are too long
41
tokio/sync/mpsc/struct.WeakUnboundedSender.html
Normal file
41
tokio/sync/mpsc/struct.WeakUnboundedSender.html
Normal file
File diff suppressed because one or more lines are too long
11
tokio/sync/mpsc/unbounded/fn.unbounded_channel.html
Normal file
11
tokio/sync/mpsc/unbounded/fn.unbounded_channel.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../../tokio/sync/mpsc/fn.unbounded_channel.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../../tokio/sync/mpsc/fn.unbounded_channel.html">../../../../tokio/sync/mpsc/fn.unbounded_channel.html</a>...</p>
|
||||
<script>location.replace("../../../../tokio/sync/mpsc/fn.unbounded_channel.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
tokio/sync/mpsc/unbounded/struct.UnboundedReceiver.html
Normal file
11
tokio/sync/mpsc/unbounded/struct.UnboundedReceiver.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../../tokio/sync/mpsc/struct.UnboundedReceiver.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../../tokio/sync/mpsc/struct.UnboundedReceiver.html">../../../../tokio/sync/mpsc/struct.UnboundedReceiver.html</a>...</p>
|
||||
<script>location.replace("../../../../tokio/sync/mpsc/struct.UnboundedReceiver.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
tokio/sync/mpsc/unbounded/struct.UnboundedSender.html
Normal file
11
tokio/sync/mpsc/unbounded/struct.UnboundedSender.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../../tokio/sync/mpsc/struct.UnboundedSender.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../../tokio/sync/mpsc/struct.UnboundedSender.html">../../../../tokio/sync/mpsc/struct.UnboundedSender.html</a>...</p>
|
||||
<script>location.replace("../../../../tokio/sync/mpsc/struct.UnboundedSender.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
tokio/sync/mpsc/unbounded/struct.WeakUnboundedSender.html
Normal file
11
tokio/sync/mpsc/unbounded/struct.WeakUnboundedSender.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../../tokio/sync/mpsc/struct.WeakUnboundedSender.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../../tokio/sync/mpsc/struct.WeakUnboundedSender.html">../../../../tokio/sync/mpsc/struct.WeakUnboundedSender.html</a>...</p>
|
||||
<script>location.replace("../../../../tokio/sync/mpsc/struct.WeakUnboundedSender.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue