index.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta name="generator" content="rustdoc">
  7. <meta name="description" content="API documentation for the Rust `mpsc` mod in crate `futures`.">
  8. <meta name="keywords" content="rust, rustlang, rust-lang, mpsc">
  9. <title>futures::unsync::mpsc - Rust</title>
  10. <link rel="stylesheet" type="text/css" href="../../../normalize.css">
  11. <link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle">
  12. <link rel="stylesheet" type="text/css" href="../../../dark.css">
  13. <link rel="stylesheet" type="text/css" href="../../../main.css" id="themeStyle">
  14. <script src="../../../storage.js"></script>
  15. </head>
  16. <body class="rustdoc mod">
  17. <!--[if lte IE 8]>
  18. <div class="warning">
  19. This old browser is unsupported and will most likely display funky
  20. things.
  21. </div>
  22. <![endif]-->
  23. <nav class="sidebar">
  24. <div class="sidebar-menu">&#9776;</div>
  25. <p class='location'>Module mpsc</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#functions">Functions</a></li></ul></div><p class='location'><a href='../../index.html'>futures</a>::<wbr><a href='../index.html'>unsync</a></p><script>window.sidebarCurrent = {name: 'mpsc', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div>
  26. </nav>
  27. <div class="theme-picker">
  28. <button id="theme-picker" aria-label="Pick another theme!">
  29. <img src="../../../brush.svg" width="18" alt="Pick another theme!">
  30. </button>
  31. <div id="theme-choices"></div>
  32. </div>
  33. <script src="../../../theme.js"></script>
  34. <nav class="sub">
  35. <form class="search-form js-only">
  36. <div class="search-container">
  37. <input class="search-input" name="search"
  38. autocomplete="off"
  39. placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
  40. type="search">
  41. </div>
  42. </form>
  43. </nav>
  44. <section id='main' class="content">
  45. <h1 class='fqn'><span class='in-band'>Module <a href='../../index.html'>futures</a>::<wbr><a href='../index.html'>unsync</a>::<wbr><a class="mod" href=''>mpsc</a></span><span class='out-of-band'><span id='render-detail'>
  46. <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
  47. [<span class='inner'>&#x2212;</span>]
  48. </a>
  49. </span><a class='srclink' href='../../../src/futures/unsync/mpsc.rs.html#1-474' title='goto source code'>[src]</a></span></h1>
  50. <div class='docblock'><p>A multi-producer, single-consumer, futures-aware, FIFO queue with back
  51. pressure, for use communicating between tasks on the same thread.</p>
  52. <p>These queues are the same as those in <code>futures::sync</code>, except they're not
  53. intended to be sent across threads.</p>
  54. </div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
  55. <table>
  56. <tr class=' module-item'>
  57. <td><a class="struct" href="struct.Execute.html"
  58. title='struct futures::unsync::mpsc::Execute'>Execute</a></td>
  59. <td class='docblock-short'>
  60. <p>Type of future which <code>Executor</code> instances must be able to execute for <code>spawn</code>.</p>
  61. </td>
  62. </tr>
  63. <tr class=' module-item'>
  64. <td><a class="struct" href="struct.Receiver.html"
  65. title='struct futures::unsync::mpsc::Receiver'>Receiver</a></td>
  66. <td class='docblock-short'>
  67. <p>The receiving end of a channel which implements the <code>Stream</code> trait.</p>
  68. </td>
  69. </tr>
  70. <tr class=' module-item'>
  71. <td><a class="struct" href="struct.SendError.html"
  72. title='struct futures::unsync::mpsc::SendError'>SendError</a></td>
  73. <td class='docblock-short'>
  74. <p>Error type for sending, used when the receiving end of a channel is
  75. dropped</p>
  76. </td>
  77. </tr>
  78. <tr class=' module-item'>
  79. <td><a class="struct" href="struct.Sender.html"
  80. title='struct futures::unsync::mpsc::Sender'>Sender</a></td>
  81. <td class='docblock-short'>
  82. <p>The transmission end of a channel.</p>
  83. </td>
  84. </tr>
  85. <tr class=' module-item'>
  86. <td><a class="struct" href="struct.SpawnHandle.html"
  87. title='struct futures::unsync::mpsc::SpawnHandle'>SpawnHandle</a></td>
  88. <td class='docblock-short'>
  89. <p>Handle returned from the <code>spawn</code> function.</p>
  90. </td>
  91. </tr>
  92. <tr class=' module-item'>
  93. <td><a class="struct" href="struct.UnboundedReceiver.html"
  94. title='struct futures::unsync::mpsc::UnboundedReceiver'>UnboundedReceiver</a></td>
  95. <td class='docblock-short'>
  96. <p>The receiving end of an unbounded channel.</p>
  97. </td>
  98. </tr>
  99. <tr class=' module-item'>
  100. <td><a class="struct" href="struct.UnboundedSender.html"
  101. title='struct futures::unsync::mpsc::UnboundedSender'>UnboundedSender</a></td>
  102. <td class='docblock-short'>
  103. <p>The transmission end of an unbounded channel.</p>
  104. </td>
  105. </tr></table><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
  106. <table>
  107. <tr class=' module-item'>
  108. <td><a class="fn" href="fn.channel.html"
  109. title='fn futures::unsync::mpsc::channel'>channel</a></td>
  110. <td class='docblock-short'>
  111. <p>Creates a bounded in-memory channel with buffered storage.</p>
  112. </td>
  113. </tr>
  114. <tr class=' module-item'>
  115. <td><a class="fn" href="fn.spawn.html"
  116. title='fn futures::unsync::mpsc::spawn'>spawn</a></td>
  117. <td class='docblock-short'>
  118. <p>Spawns a <code>stream</code> onto the instance of <code>Executor</code> provided, <code>executor</code>,
  119. returning a handle representing the remote stream.</p>
  120. </td>
  121. </tr>
  122. <tr class=' module-item'>
  123. <td><a class="fn" href="fn.spawn_unbounded.html"
  124. title='fn futures::unsync::mpsc::spawn_unbounded'>spawn_unbounded</a></td>
  125. <td class='docblock-short'>
  126. <p>Spawns a <code>stream</code> onto the instance of <code>Executor</code> provided, <code>executor</code>,
  127. returning a handle representing the remote stream, with unbounded buffering.</p>
  128. </td>
  129. </tr>
  130. <tr class=' module-item'>
  131. <td><a class="fn" href="fn.unbounded.html"
  132. title='fn futures::unsync::mpsc::unbounded'>unbounded</a></td>
  133. <td class='docblock-short'>
  134. <p>Creates an unbounded in-memory channel with buffered storage.</p>
  135. </td>
  136. </tr></table></section>
  137. <section id='search' class="content hidden"></section>
  138. <section class="footer"></section>
  139. <aside id="help" class="hidden">
  140. <div>
  141. <h1 class="hidden">Help</h1>
  142. <div class="shortcuts">
  143. <h2>Keyboard Shortcuts</h2>
  144. <dl>
  145. <dt><kbd>?</kbd></dt>
  146. <dd>Show this help dialog</dd>
  147. <dt><kbd>S</kbd></dt>
  148. <dd>Focus the search field</dd>
  149. <dt><kbd>↑</kbd></dt>
  150. <dd>Move up in search results</dd>
  151. <dt><kbd>↓</kbd></dt>
  152. <dd>Move down in search results</dd>
  153. <dt><kbd>↹</kbd></dt>
  154. <dd>Switch tab</dd>
  155. <dt><kbd>&#9166;</kbd></dt>
  156. <dd>Go to active search result</dd>
  157. <dt><kbd>+</kbd></dt>
  158. <dd>Expand all sections</dd>
  159. <dt><kbd>-</kbd></dt>
  160. <dd>Collapse all sections</dd>
  161. </dl>
  162. </div>
  163. <div class="infos">
  164. <h2>Search Tricks</h2>
  165. <p>
  166. Prefix searches with a type followed by a colon (e.g.
  167. <code>fn:</code>) to restrict the search to a given type.
  168. </p>
  169. <p>
  170. Accepted types are: <code>fn</code>, <code>mod</code>,
  171. <code>struct</code>, <code>enum</code>,
  172. <code>trait</code>, <code>type</code>, <code>macro</code>,
  173. and <code>const</code>.
  174. </p>
  175. <p>
  176. Search functions by type signature (e.g.
  177. <code>vec -> usize</code> or <code>* -> vec</code>)
  178. </p>
  179. </div>
  180. </div>
  181. </aside>
  182. <script>
  183. window.rootPath = "../../../";
  184. window.currentCrate = "futures";
  185. </script>
  186. <script src="../../../main.js"></script>
  187. <script defer src="../../../search-index.js"></script>
  188. </body>
  189. </html>