index.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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 `sink` mod in crate `futures`.">
  8. <meta name="keywords" content="rust, rustlang, rust-lang, sink">
  9. <title>futures::sink - 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 sink</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#traits">Traits</a></li><li><a href="#types">Type Definitions</a></li></ul></div><p class='location'><a href='../index.html'>futures</a></p><script>window.sidebarCurrent = {name: 'sink', 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 class="mod" href=''>sink</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/sink/mod.rs.html#1-489' title='goto source code'>[src]</a></span></h1>
  50. <div class='docblock'><p>Asynchronous sinks</p>
  51. <p>This module contains the <code>Sink</code> trait, along with a number of adapter types
  52. for it. An overview is available in the documentation for the trait itself.</p>
  53. <p>You can find more information/tutorials about streams <a href="https://tokio.rs/docs/getting-started/streams-and-sinks/">online at
  54. https://tokio.rs</a></p>
  55. </div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
  56. <table>
  57. <tr class=' module-item'>
  58. <td><a class="struct" href="struct.Buffer.html"
  59. title='struct futures::sink::Buffer'>Buffer</a></td>
  60. <td class='docblock-short'>
  61. <p>Sink for the <code>Sink::buffer</code> combinator, which buffers up to some fixed
  62. number of values when the underlying sink is unable to accept them.</p>
  63. </td>
  64. </tr>
  65. <tr class=' module-item'>
  66. <td><a class="struct" href="struct.Fanout.html"
  67. title='struct futures::sink::Fanout'>Fanout</a></td>
  68. <td class='docblock-short'>
  69. <p>Sink that clones incoming items and forwards them to two sinks at the same time.</p>
  70. </td>
  71. </tr>
  72. <tr class=' module-item'>
  73. <td><a class="struct" href="struct.Flush.html"
  74. title='struct futures::sink::Flush'>Flush</a></td>
  75. <td class='docblock-short'>
  76. <p>Future for the <code>Sink::flush</code> combinator, which polls the sink until all data
  77. has been flushed.</p>
  78. </td>
  79. </tr>
  80. <tr class=' module-item'>
  81. <td><a class="struct" href="struct.Send.html"
  82. title='struct futures::sink::Send'>Send</a></td>
  83. <td class='docblock-short'>
  84. <p>Future for the <code>Sink::send</code> combinator, which sends a value to a sink and
  85. then waits until the sink has fully flushed.</p>
  86. </td>
  87. </tr>
  88. <tr class=' module-item'>
  89. <td><a class="struct" href="struct.SendAll.html"
  90. title='struct futures::sink::SendAll'>SendAll</a></td>
  91. <td class='docblock-short'>
  92. <p>Future for the <code>Sink::send_all</code> combinator, which sends a stream of values
  93. to a sink and then waits until the sink has fully flushed those values.</p>
  94. </td>
  95. </tr>
  96. <tr class=' module-item'>
  97. <td><a class="struct" href="struct.SinkFromErr.html"
  98. title='struct futures::sink::SinkFromErr'>SinkFromErr</a></td>
  99. <td class='docblock-short'>
  100. <p>A sink combinator to change the error type of a sink.</p>
  101. </td>
  102. </tr>
  103. <tr class=' module-item'>
  104. <td><a class="struct" href="struct.SinkMapErr.html"
  105. title='struct futures::sink::SinkMapErr'>SinkMapErr</a></td>
  106. <td class='docblock-short'>
  107. <p>Sink for the <code>Sink::sink_map_err</code> combinator.</p>
  108. </td>
  109. </tr>
  110. <tr class=' module-item'>
  111. <td><a class="struct" href="struct.Wait.html"
  112. title='struct futures::sink::Wait'>Wait</a></td>
  113. <td class='docblock-short'>
  114. <p>A sink combinator which converts an asynchronous sink to a <strong>blocking
  115. sink</strong>.</p>
  116. </td>
  117. </tr>
  118. <tr class=' module-item'>
  119. <td><a class="struct" href="struct.With.html"
  120. title='struct futures::sink::With'>With</a></td>
  121. <td class='docblock-short'>
  122. <p>Sink for the <code>Sink::with</code> combinator, chaining a computation to run <em>prior</em>
  123. to pushing a value into the underlying sink.</p>
  124. </td>
  125. </tr>
  126. <tr class=' module-item'>
  127. <td><a class="struct" href="struct.WithFlatMap.html"
  128. title='struct futures::sink::WithFlatMap'>WithFlatMap</a></td>
  129. <td class='docblock-short'>
  130. <p>Sink for the <code>Sink::with_flat_map</code> combinator, chaining a computation that returns an iterator
  131. to run prior to pushing a value into the underlying sink</p>
  132. </td>
  133. </tr></table><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2>
  134. <table>
  135. <tr class=' module-item'>
  136. <td><a class="trait" href="trait.Sink.html"
  137. title='trait futures::sink::Sink'>Sink</a></td>
  138. <td class='docblock-short'>
  139. <p>A <code>Sink</code> is a value into which other values can be sent, asynchronously.</p>
  140. </td>
  141. </tr></table><h2 id='types' class='section-header'><a href="#types">Type Definitions</a></h2>
  142. <table>
  143. <tr class=' module-item'>
  144. <td><a class="type" href="type.BoxSink.html"
  145. title='type futures::sink::BoxSink'>BoxSink</a></td>
  146. <td class='docblock-short'>
  147. <p>A type alias for <code>Box&lt;Sink + Send&gt;</code></p>
  148. </td>
  149. </tr></table></section>
  150. <section id='search' class="content hidden"></section>
  151. <section class="footer"></section>
  152. <aside id="help" class="hidden">
  153. <div>
  154. <h1 class="hidden">Help</h1>
  155. <div class="shortcuts">
  156. <h2>Keyboard Shortcuts</h2>
  157. <dl>
  158. <dt><kbd>?</kbd></dt>
  159. <dd>Show this help dialog</dd>
  160. <dt><kbd>S</kbd></dt>
  161. <dd>Focus the search field</dd>
  162. <dt><kbd>↑</kbd></dt>
  163. <dd>Move up in search results</dd>
  164. <dt><kbd>↓</kbd></dt>
  165. <dd>Move down in search results</dd>
  166. <dt><kbd>↹</kbd></dt>
  167. <dd>Switch tab</dd>
  168. <dt><kbd>&#9166;</kbd></dt>
  169. <dd>Go to active search result</dd>
  170. <dt><kbd>+</kbd></dt>
  171. <dd>Expand all sections</dd>
  172. <dt><kbd>-</kbd></dt>
  173. <dd>Collapse all sections</dd>
  174. </dl>
  175. </div>
  176. <div class="infos">
  177. <h2>Search Tricks</h2>
  178. <p>
  179. Prefix searches with a type followed by a colon (e.g.
  180. <code>fn:</code>) to restrict the search to a given type.
  181. </p>
  182. <p>
  183. Accepted types are: <code>fn</code>, <code>mod</code>,
  184. <code>struct</code>, <code>enum</code>,
  185. <code>trait</code>, <code>type</code>, <code>macro</code>,
  186. and <code>const</code>.
  187. </p>
  188. <p>
  189. Search functions by type signature (e.g.
  190. <code>vec -> usize</code> or <code>* -> vec</code>)
  191. </p>
  192. </div>
  193. </div>
  194. </aside>
  195. <script>
  196. window.rootPath = "../../";
  197. window.currentCrate = "futures";
  198. </script>
  199. <script src="../../main.js"></script>
  200. <script defer src="../../search-index.js"></script>
  201. </body>
  202. </html>