clfft 0.3.2

Bindings for clFFT, a FFT library for OpenCL.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="generator" content="rustdoc">
    <meta name="description" content="API documentation for the Rust `Stream` trait in crate `futures`.">
    <meta name="keywords" content="rust, rustlang, rust-lang, Stream">

    <title>futures::stream::Stream - Rust</title>

    <link rel="stylesheet" type="text/css" href="../../normalize.css">
    <link rel="stylesheet" type="text/css" href="../../rustdoc.css">
    <link rel="stylesheet" type="text/css" href="../../main.css">
    

    
    
</head>
<body class="rustdoc trait">
    <!--[if lte IE 8]>
    <div class="warning">
        This old browser is unsupported and will most likely display funky
        things.
    </div>
    <![endif]-->

    

    <nav class="sidebar">
        
        <p class='location'><a href='../index.html'>futures</a>::<wbr><a href='index.html'>stream</a></p><script>window.sidebarCurrent = {name: 'Stream', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script>
    </nav>

    <nav class="sub">
        <form class="search-form js-only">
            <div class="search-container">
                <input class="search-input" name="search"
                       autocomplete="off"
                       placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
                       type="search">
            </div>
        </form>
    </nav>

    <section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Trait <a href='../index.html'>futures</a>::<wbr><a href='index.html'>stream</a>::<wbr><a class="trait" href=''>Stream</a></span><span class='out-of-band'><span id='render-detail'>
                   <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
                       [<span class='inner'>&#x2212;</span>]
                   </a>
               </span><a class='srclink' href='../../src/futures/stream/mod.rs.html#162-1052' title='goto source code'>[src]</a></span></h1>
<pre class='rust trait'>pub trait Stream {
    type <a href='#associatedtype.Item' class="type">Item</a>;
    type <a href='#associatedtype.Error' class="type">Error</a>;
    fn <a href='#tymethod.poll' class='fnname'>poll</a>(&amp;mut self) -&gt; <a class="type" href="../../futures/type.Poll.html" title="type futures::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>&gt;, Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;;

    fn <a href='#method.wait' class='fnname'>wait</a>(self) -&gt; <a class="struct" href="../../futures/stream/struct.Wait.html" title="struct futures::stream::Wait">Wait</a>&lt;Self&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
    { ... }
    fn <a href='#method.boxed' class='fnname'>boxed</a>(self) -&gt; <a class="type" href="../../futures/stream/type.BoxStream.html" title="type futures::stream::BoxStream">BoxStream</a>&lt;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>, Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'static</span>,
    { ... }
    fn <a href='#method.into_future' class='fnname'>into_future</a>(self) -&gt; <a class="struct" href="../../futures/stream/struct.StreamFuture.html" title="struct futures::stream::StreamFuture">StreamFuture</a>&lt;Self&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
    { ... }
    fn <a href='#method.map' class='fnname'>map</a>&lt;U, F&gt;(self, f: F) -&gt; <a class="struct" href="../../futures/stream/struct.Map.html" title="struct futures::stream::Map">Map</a>&lt;Self, F&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>) -&gt; U,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
    { ... }
    fn <a href='#method.map_err' class='fnname'>map_err</a>&lt;U, F&gt;(self, f: F) -&gt; <a class="struct" href="../../futures/stream/struct.MapErr.html" title="struct futures::stream::MapErr">MapErr</a>&lt;Self, F&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>) -&gt; U,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
    { ... }
    fn <a href='#method.filter' class='fnname'>filter</a>&lt;F&gt;(self, f: F) -&gt; <a class="struct" href="../../futures/stream/struct.Filter.html" title="struct futures::stream::Filter">Filter</a>&lt;Self, F&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(&amp;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
    { ... }
    fn <a href='#method.filter_map' class='fnname'>filter_map</a>&lt;F, B&gt;(self, f: F) -&gt; <a class="struct" href="../../futures/stream/struct.FilterMap.html" title="struct futures::stream::FilterMap">FilterMap</a>&lt;Self, F&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;B&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
    { ... }
    fn <a href='#method.then' class='fnname'>then</a>&lt;F, U&gt;(self, f: F) -&gt; <a class="struct" href="../../futures/stream/struct.Then.html" title="struct futures::stream::Then">Then</a>&lt;Self, F, U&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>, Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;) -&gt; U,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
    { ... }
    fn <a href='#method.and_then' class='fnname'>and_then</a>&lt;F, U&gt;(self, f: F) -&gt; <a class="struct" href="../../futures/stream/struct.AndThen.html" title="struct futures::stream::AndThen">AndThen</a>&lt;Self, F, U&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>) -&gt; U,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&lt;Error = Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
    { ... }
    fn <a href='#method.or_else' class='fnname'>or_else</a>&lt;F, U&gt;(self, f: F) -&gt; <a class="struct" href="../../futures/stream/struct.OrElse.html" title="struct futures::stream::OrElse">OrElse</a>&lt;Self, F, U&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>) -&gt; U,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&lt;Item = Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
    { ... }
    fn <a href='#method.collect' class='fnname'>collect</a>(self) -&gt; <a class="struct" href="../../futures/stream/struct.Collect.html" title="struct futures::stream::Collect">Collect</a>&lt;Self&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
    { ... }
    fn <a href='#method.concat2' class='fnname'>concat2</a>(self) -&gt; <a class="struct" href="../../futures/stream/struct.Concat2.html" title="struct futures::stream::Concat2">Concat2</a>&lt;Self&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.Extend.html" title="trait core::iter::traits::Extend">Extend</a>&lt;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>::<a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html" title="trait core::iter::traits::IntoIterator">Item</a>&gt; + <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html" title="trait core::iter::traits::IntoIterator">IntoIterator</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a></span>,
    { ... }
    fn <a href='#method.concat' class='fnname'>concat</a>(self) -&gt; <a class="struct" href="../../futures/stream/struct.Concat.html" title="struct futures::stream::Concat">Concat</a>&lt;Self&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.Extend.html" title="trait core::iter::traits::Extend">Extend</a>&lt;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>::<a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html" title="trait core::iter::traits::IntoIterator">Item</a>&gt; + <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html" title="trait core::iter::traits::IntoIterator">IntoIterator</a></span>,
    { ... }
    fn <a href='#method.fold' class='fnname'>fold</a>&lt;F, T, Fut&gt;(self, init: T, f: F) -&gt; <a class="struct" href="../../futures/stream/struct.Fold.html" title="struct futures::stream::Fold">Fold</a>&lt;Self, F, Fut, T&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(T, Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>) -&gt; Fut,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fut: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&lt;Item = T&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;Fut::<a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">Error</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
    { ... }
    fn <a href='#method.flatten' class='fnname'>flatten</a>(self) -&gt; <a class="struct" href="../../futures/stream/struct.Flatten.html" title="struct futures::stream::Flatten">Flatten</a>&lt;Self&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
    { ... }
    fn <a href='#method.skip_while' class='fnname'>skip_while</a>&lt;P, R&gt;(self, pred: P) -&gt; <a class="struct" href="../../futures/stream/struct.SkipWhile.html" title="struct futures::stream::SkipWhile">SkipWhile</a>&lt;Self, P, R&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(&amp;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>) -&gt; R,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, Error = Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
    { ... }
    fn <a href='#method.take_while' class='fnname'>take_while</a>&lt;P, R&gt;(self, pred: P) -&gt; <a class="struct" href="../../futures/stream/struct.TakeWhile.html" title="struct futures::stream::TakeWhile">TakeWhile</a>&lt;Self, P, R&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(&amp;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>) -&gt; R,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, Error = Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
    { ... }
    fn <a href='#method.for_each' class='fnname'>for_each</a>&lt;F, U&gt;(self, f: F) -&gt; <a class="struct" href="../../futures/stream/struct.ForEach.html" title="struct futures::stream::ForEach">ForEach</a>&lt;Self, F, U&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>) -&gt; U,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">()</a>, Error = Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
    { ... }
    fn <a href='#method.from_err' class='fnname'>from_err</a>&lt;E:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;&gt;(self) -&gt; <a class="struct" href="../../futures/stream/struct.FromErr.html" title="struct futures::stream::FromErr">FromErr</a>&lt;Self, E&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
    { ... }
    fn <a href='#method.take' class='fnname'>take</a>(self, amt: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -&gt; <a class="struct" href="../../futures/stream/struct.Take.html" title="struct futures::stream::Take">Take</a>&lt;Self&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
    { ... }
    fn <a href='#method.skip' class='fnname'>skip</a>(self, amt: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -&gt; <a class="struct" href="../../futures/stream/struct.Skip.html" title="struct futures::stream::Skip">Skip</a>&lt;Self&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
    { ... }
    fn <a href='#method.fuse' class='fnname'>fuse</a>(self) -&gt; <a class="struct" href="../../futures/stream/struct.Fuse.html" title="struct futures::stream::Fuse">Fuse</a>&lt;Self&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
    { ... }
    fn <a href='#method.by_ref' class='fnname'>by_ref</a>(&amp;mut self) -&gt; &amp;mut Self<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
    { ... }
    fn <a href='#method.catch_unwind' class='fnname'>catch_unwind</a>(self) -&gt; <a class="struct" href="../../futures/stream/struct.CatchUnwind.html" title="struct futures::stream::CatchUnwind">CatchUnwind</a>&lt;Self&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a></span>,
    { ... }
    fn <a href='#method.buffered' class='fnname'>buffered</a>(self, amt: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="../../futures/stream/struct.Buffered.html" title="struct futures::stream::Buffered">Buffered</a>&lt;Self&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&lt;Error = Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
    { ... }
    fn <a href='#method.buffer_unordered' class='fnname'>buffer_unordered</a>(self, amt: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="../../futures/stream/struct.BufferUnordered.html" title="struct futures::stream::BufferUnordered">BufferUnordered</a>&lt;Self&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&lt;Error = Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
    { ... }
    fn <a href='#method.merge' class='fnname'>merge</a>&lt;S&gt;(self, other: S) -&gt; <a class="struct" href="../../futures/stream/struct.Merge.html" title="struct futures::stream::Merge">Merge</a>&lt;Self, S&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>&lt;Error = Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
    { ... }
    fn <a href='#method.zip' class='fnname'>zip</a>&lt;S&gt;(self, other: S) -&gt; <a class="struct" href="../../futures/stream/struct.Zip.html" title="struct futures::stream::Zip">Zip</a>&lt;Self, S&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>&lt;Error = Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
    { ... }
    fn <a href='#method.chain' class='fnname'>chain</a>&lt;S&gt;(self, other: S) -&gt; <a class="struct" href="../../futures/stream/struct.Chain.html" title="struct futures::stream::Chain">Chain</a>&lt;Self, S&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>&lt;Item = Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>, Error = Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
    { ... }
    fn <a href='#method.peekable' class='fnname'>peekable</a>(self) -&gt; <a class="struct" href="../../futures/stream/struct.Peekable.html" title="struct futures::stream::Peekable">Peekable</a>&lt;Self&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
    { ... }
    fn <a href='#method.chunks' class='fnname'>chunks</a>(self, capacity: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="../../futures/stream/struct.Chunks.html" title="struct futures::stream::Chunks">Chunks</a>&lt;Self&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
    { ... }
    fn <a href='#method.select' class='fnname'>select</a>&lt;S&gt;(self, other: S) -&gt; <a class="struct" href="../../futures/stream/struct.Select.html" title="struct futures::stream::Select">Select</a>&lt;Self, S&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>&lt;Item = Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>, Error = Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
    { ... }
    fn <a href='#method.forward' class='fnname'>forward</a>&lt;S&gt;(self, sink: S) -&gt; <a class="struct" href="../../futures/stream/struct.Forward.html" title="struct futures::stream::Forward">Forward</a>&lt;Self, S&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a>&lt;SinkItem = Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;S::<a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">SinkError</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
    { ... }
    fn <a href='#method.split' class='fnname'>split</a>(self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="../../futures/stream/struct.SplitSink.html" title="struct futures::stream::SplitSink">SplitSink</a>&lt;Self&gt;, <a class="struct" href="../../futures/stream/struct.SplitStream.html" title="struct futures::stream::SplitStream">SplitStream</a>&lt;Self&gt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a><br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
    { ... }
}</pre><div class='docblock'><p>A stream of values, not all of which may have been produced yet.</p>
<p><code>Stream</code> is a trait to represent any source of sequential events or items
which acts like an iterator but long periods of time may pass between
items. Like <code>Future</code> the methods of <code>Stream</code> never block and it is thus
suitable for programming in an asynchronous fashion. This trait is very
similar to the <code>Iterator</code> trait in the standard library where <code>Some</code> is
used to signal elements of the stream and <code>None</code> is used to indicate that
the stream is finished.</p>
<p>Like futures a stream has basic combinators to transform the stream, perform
more work on each item, etc.</p>
<p>You can find more information/tutorials about streams <a href="https://tokio.rs/docs/getting-started/streams-and-sinks/">online at
https://tokio.rs</a></p>
<h1 id="streams-as-futures" class="section-header"><a href="#streams-as-futures">Streams as Futures</a></h1>
<p>Any instance of <code>Stream</code> can also be viewed as a <code>Future</code> where the resolved
value is the next item in the stream along with the rest of the stream. The
<code>into_future</code> adaptor can be used here to convert any stream into a future
for use with other future methods like <code>join</code> and <code>select</code>.</p>
<h1 id="errors" class="section-header"><a href="#errors">Errors</a></h1>
<p>Streams, like futures, can also model errors in their computation. All
streams have an associated <code>Error</code> type like with futures. Currently as of
the 0.1 release of this library an error on a stream <strong>does not terminate
the stream</strong>. That is, after one error is received, another error may be
received from the same stream (it's valid to keep polling).</p>
<p>This property of streams, however, is <a href="https://github.com/alexcrichton/futures-rs/issues/206">being considered</a> for change in 0.2
where an error on a stream is similar to <code>None</code>, it terminates the stream
entirely. If one of these use cases suits you perfectly and not the other,
please feel welcome to comment on <a href="https://github.com/alexcrichton/futures-rs/issues/206">the issue</a>!</p>
</div>
            <h2 id='associated-types'>Associated Types</h2>
            <div class='methods'>
        <h3 id='associatedtype.Item' class='method'><span id='Item.t' class='invisible'><code>type <a href='#associatedtype.Item' class="type">Item</a></code></span></h3><div class='docblock'><p>The type of item this stream will yield on success.</p>
</div><h3 id='associatedtype.Error' class='method'><span id='Error.t' class='invisible'><code>type <a href='#associatedtype.Error' class="type">Error</a></code></span></h3><div class='docblock'><p>The type of error this stream may generate.</p>
</div></div>
            <h2 id='required-methods'>Required Methods</h2>
            <div class='methods'>
        <h3 id='tymethod.poll' class='method'><span id='poll.v' class='invisible'><code>fn <a href='#tymethod.poll' class='fnname'>poll</a>(&amp;mut self) -&gt; <a class="type" href="../../futures/type.Poll.html" title="type futures::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>&gt;, Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;</code></span></h3><div class='docblock'><p>Attempt to pull out the next value of this stream, returning <code>None</code> if
the stream is finished.</p>
<p>This method, like <code>Future::poll</code>, is the sole method of pulling out a
value from a stream. This method must also be run within the context of
a task typically and implementors of this trait must ensure that
implementations of this method do not block, as it may cause consumers
to behave badly.</p>
<h1 id="return-value" class="section-header"><a href="#return-value">Return value</a></h1>
<p>If <code>NotReady</code> is returned then this stream's next value is not ready
yet and implementations will ensure that the current task will be
notified when the next value may be ready. If <code>Some</code> is returned then
the returned value represents the next value on the stream. <code>Err</code>
indicates an error happened, while <code>Ok</code> indicates whether there was a
new item on the stream or whether the stream has terminated.</p>
<h1 id="panics" class="section-header"><a href="#panics">Panics</a></h1>
<p>Once a stream is finished, that is <code>Ready(None)</code> has been returned,
further calls to <code>poll</code> may result in a panic or other &quot;bad behavior&quot;.
If this is difficult to guard against then the <code>fuse</code> adapter can be
used to ensure that <code>poll</code> always has well-defined semantics.</p>
</div></div>
            <h2 id='provided-methods'>Provided Methods</h2>
            <div class='methods'>
        <h3 id='method.wait' class='method'><span id='wait.v' class='invisible'><code>fn <a href='#method.wait' class='fnname'>wait</a>(self) -&gt; <a class="struct" href="../../futures/stream/struct.Wait.html" title="struct futures::stream::Wait">Wait</a>&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>Creates an iterator which blocks the current thread until each item of
this stream is resolved.</p>
<p>This method will consume ownership of this stream, returning an
implementation of a standard iterator. This iterator will <em>block the
current thread</em> on each call to <code>next</code> if the item in the stream isn't
ready yet.</p>
<blockquote>
<p><strong>Note:</strong> This method is not appropriate to call on event loops or
similar I/O situations because it will prevent the event
loop from making progress (this blocks the thread). This
method should only be called when it's guaranteed that the
blocking work associated with this stream will be completed
by another thread.</p>
</blockquote>
<p>This method is only available when the <code>use_std</code> feature of this
library is activated, and it is activated by default.</p>
<h1 id="panics-1" class="section-header"><a href="#panics-1">Panics</a></h1>
<p>The returned iterator does not attempt to catch panics. If the <code>poll</code>
function panics, panics will be propagated to the caller of <code>next</code>.</p>
</div><h3 id='method.boxed' class='method'><span id='boxed.v' class='invisible'><code>fn <a href='#method.boxed' class='fnname'>boxed</a>(self) -&gt; <a class="type" href="../../futures/stream/type.BoxStream.html" title="type futures::stream::BoxStream">BoxStream</a>&lt;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>, Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'static,&nbsp;</span></code></span></h3><div class='docblock'><p>Convenience function for turning this stream into a trait object.</p>
<p>This simply avoids the need to write <code>Box::new</code> and can often help with
type inference as well by always returning a trait object. Note that
this method requires the <code>Send</code> bound and returns a <code>BoxStream</code>, which
also encodes this. If you'd like to create a <code>Box&lt;Stream&gt;</code> without the
<code>Send</code> bound, then the <code>Box::new</code> function can be used instead.</p>
<p>This method is only available when the <code>use_std</code> feature of this
library is activated, and it is activated by default.</p>
<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">futures</span>::<span class="ident">stream</span>::<span class="kw-2">*</span>;
<span class="kw">use</span> <span class="ident">futures</span>::<span class="ident">sync</span>::<span class="ident">mpsc</span>;

<span class="kw">let</span> (<span class="ident">_tx</span>, <span class="ident">rx</span>) <span class="op">=</span> <span class="ident">mpsc</span>::<span class="ident">channel</span>(<span class="number">1</span>);
<span class="kw">let</span> <span class="ident">a</span>: <span class="ident">BoxStream</span><span class="op">&lt;</span><span class="ident">i32</span>, ()<span class="op">&gt;</span> <span class="op">=</span> <span class="ident">rx</span>.<span class="ident">boxed</span>();</pre>
</div><h3 id='method.into_future' class='method'><span id='into_future.v' class='invisible'><code>fn <a href='#method.into_future' class='fnname'>into_future</a>(self) -&gt; <a class="struct" href="../../futures/stream/struct.StreamFuture.html" title="struct futures::stream::StreamFuture">StreamFuture</a>&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>Converts this stream into a <code>Future</code>.</p>
<p>A stream can be viewed as a future which will resolve to a pair containing
the next element of the stream plus the remaining stream. If the stream
terminates, then the next element is <code>None</code> and the remaining stream is
still passed back, to allow reclamation of its resources.</p>
<p>The returned future can be used to compose streams and futures together by
placing everything into the &quot;world of futures&quot;.</p>
</div><h3 id='method.map' class='method'><span id='map.v' class='invisible'><code>fn <a href='#method.map' class='fnname'>map</a>&lt;U, F&gt;(self, f: F) -&gt; <a class="struct" href="../../futures/stream/struct.Map.html" title="struct futures::stream::Map">Map</a>&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>) -&gt; U,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>Converts a stream of type <code>T</code> to a stream of type <code>U</code>.</p>
<p>The provided closure is executed over all elements of this stream as
they are made available, and the callback will be executed inline with
calls to <code>poll</code>.</p>
<p>Note that this function consumes the receiving stream and returns a
wrapped version of it, similar to the existing <code>map</code> methods in the
standard library.</p>
<h1 id="examples-1" class="section-header"><a href="#examples-1">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">futures</span>::<span class="ident">Stream</span>;
<span class="kw">use</span> <span class="ident">futures</span>::<span class="ident">sync</span>::<span class="ident">mpsc</span>;

<span class="kw">let</span> (<span class="ident">_tx</span>, <span class="ident">rx</span>) <span class="op">=</span> <span class="ident">mpsc</span>::<span class="ident">channel</span>::<span class="op">&lt;</span><span class="ident">i32</span><span class="op">&gt;</span>(<span class="number">1</span>);
<span class="kw">let</span> <span class="ident">rx</span> <span class="op">=</span> <span class="ident">rx</span>.<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span> <span class="op">+</span> <span class="number">3</span>);</pre>
</div><h3 id='method.map_err' class='method'><span id='map_err.v' class='invisible'><code>fn <a href='#method.map_err' class='fnname'>map_err</a>&lt;U, F&gt;(self, f: F) -&gt; <a class="struct" href="../../futures/stream/struct.MapErr.html" title="struct futures::stream::MapErr">MapErr</a>&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>) -&gt; U,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>Converts a stream of error type <code>T</code> to a stream of error type <code>U</code>.</p>
<p>The provided closure is executed over all errors of this stream as
they are made available, and the callback will be executed inline with
calls to <code>poll</code>.</p>
<p>Note that this function consumes the receiving stream and returns a
wrapped version of it, similar to the existing <code>map_err</code> methods in the
standard library.</p>
<h1 id="examples-2" class="section-header"><a href="#examples-2">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">futures</span>::<span class="ident">Stream</span>;
<span class="kw">use</span> <span class="ident">futures</span>::<span class="ident">sync</span>::<span class="ident">mpsc</span>;

<span class="kw">let</span> (<span class="ident">_tx</span>, <span class="ident">rx</span>) <span class="op">=</span> <span class="ident">mpsc</span>::<span class="ident">channel</span>::<span class="op">&lt;</span><span class="ident">i32</span><span class="op">&gt;</span>(<span class="number">1</span>);
<span class="kw">let</span> <span class="ident">rx</span> <span class="op">=</span> <span class="ident">rx</span>.<span class="ident">map_err</span>(<span class="op">|</span>()<span class="op">|</span> <span class="number">3</span>);</pre>
</div><h3 id='method.filter' class='method'><span id='filter.v' class='invisible'><code>fn <a href='#method.filter' class='fnname'>filter</a>&lt;F&gt;(self, f: F) -&gt; <a class="struct" href="../../futures/stream/struct.Filter.html" title="struct futures::stream::Filter">Filter</a>&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(&amp;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>Filters the values produced by this stream according to the provided
predicate.</p>
<p>As values of this stream are made available, the provided predicate will
be run against them. If the predicate returns <code>true</code> then the stream
will yield the value, but if the predicate returns <code>false</code> then the
value will be discarded and the next value will be produced.</p>
<p>All errors are passed through without filtering in this combinator.</p>
<p>Note that this function consumes the receiving stream and returns a
wrapped version of it, similar to the existing <code>filter</code> methods in the
standard library.</p>
<h1 id="examples-3" class="section-header"><a href="#examples-3">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">futures</span>::<span class="ident">Stream</span>;
<span class="kw">use</span> <span class="ident">futures</span>::<span class="ident">sync</span>::<span class="ident">mpsc</span>;

<span class="kw">let</span> (<span class="ident">_tx</span>, <span class="ident">rx</span>) <span class="op">=</span> <span class="ident">mpsc</span>::<span class="ident">channel</span>::<span class="op">&lt;</span><span class="ident">i32</span><span class="op">&gt;</span>(<span class="number">1</span>);
<span class="kw">let</span> <span class="ident">evens</span> <span class="op">=</span> <span class="ident">rx</span>.<span class="ident">filter</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span> <span class="op">%</span> <span class="number">0</span> <span class="op">==</span> <span class="number">2</span>);</pre>
</div><h3 id='method.filter_map' class='method'><span id='filter_map.v' class='invisible'><code>fn <a href='#method.filter_map' class='fnname'>filter_map</a>&lt;F, B&gt;(self, f: F) -&gt; <a class="struct" href="../../futures/stream/struct.FilterMap.html" title="struct futures::stream::FilterMap">FilterMap</a>&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;B&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>Filters the values produced by this stream while simultaneously mapping
them to a different type.</p>
<p>As values of this stream are made available, the provided function will
be run on them. If the predicate returns <code>Some(e)</code> then the stream will
yield the value <code>e</code>, but if the predicate returns <code>None</code> then the next
value will be produced.</p>
<p>All errors are passed through without filtering in this combinator.</p>
<p>Note that this function consumes the receiving stream and returns a
wrapped version of it, similar to the existing <code>filter_map</code> methods in the
standard library.</p>
<h1 id="examples-4" class="section-header"><a href="#examples-4">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">futures</span>::<span class="ident">Stream</span>;
<span class="kw">use</span> <span class="ident">futures</span>::<span class="ident">sync</span>::<span class="ident">mpsc</span>;

<span class="kw">let</span> (<span class="ident">_tx</span>, <span class="ident">rx</span>) <span class="op">=</span> <span class="ident">mpsc</span>::<span class="ident">channel</span>::<span class="op">&lt;</span><span class="ident">i32</span><span class="op">&gt;</span>(<span class="number">1</span>);
<span class="kw">let</span> <span class="ident">evens_plus_one</span> <span class="op">=</span> <span class="ident">rx</span>.<span class="ident">filter_map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> {
    <span class="kw">if</span> <span class="ident">x</span> <span class="op">%</span> <span class="number">0</span> <span class="op">==</span> <span class="number">2</span> {
        <span class="prelude-val">Some</span>(<span class="ident">x</span> <span class="op">+</span> <span class="number">1</span>)
    } <span class="kw">else</span> {
        <span class="prelude-val">None</span>
    }
});</pre>
</div><h3 id='method.then' class='method'><span id='then.v' class='invisible'><code>fn <a href='#method.then' class='fnname'>then</a>&lt;F, U&gt;(self, f: F) -&gt; <a class="struct" href="../../futures/stream/struct.Then.html" title="struct futures::stream::Then">Then</a>&lt;Self, F, U&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>, Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;) -&gt; U,<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>Chain on a computation for when a value is ready, passing the resulting
item to the provided closure <code>f</code>.</p>
<p>This function can be used to ensure a computation runs regardless of
the next value on the stream. The closure provided will be yielded a
<code>Result</code> once a value is ready, and the returned future will then be run
to completion to produce the next value on this stream.</p>
<p>The returned value of the closure must implement the <code>IntoFuture</code> trait
and can represent some more work to be done before the composed stream
is finished. Note that the <code>Result</code> type implements the <code>IntoFuture</code>
trait so it is possible to simply alter the <code>Result</code> yielded to the
closure and return it.</p>
<p>Note that this function consumes the receiving stream and returns a
wrapped version of it.</p>
<h1 id="examples-5" class="section-header"><a href="#examples-5">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">futures</span>::<span class="ident">Stream</span>;
<span class="kw">use</span> <span class="ident">futures</span>::<span class="ident">sync</span>::<span class="ident">mpsc</span>;

<span class="kw">let</span> (<span class="ident">_tx</span>, <span class="ident">rx</span>) <span class="op">=</span> <span class="ident">mpsc</span>::<span class="ident">channel</span>::<span class="op">&lt;</span><span class="ident">i32</span><span class="op">&gt;</span>(<span class="number">1</span>);

<span class="kw">let</span> <span class="ident">rx</span> <span class="op">=</span> <span class="ident">rx</span>.<span class="ident">then</span>(<span class="op">|</span><span class="ident">result</span><span class="op">|</span> {
    <span class="kw">match</span> <span class="ident">result</span> {
        <span class="prelude-val">Ok</span>(<span class="ident">e</span>) <span class="op">=&gt;</span> <span class="prelude-val">Ok</span>(<span class="ident">e</span> <span class="op">+</span> <span class="number">3</span>),
        <span class="prelude-val">Err</span>(()) <span class="op">=&gt;</span> <span class="prelude-val">Err</span>(<span class="number">4</span>),
    }
});</pre>
</div><h3 id='method.and_then' class='method'><span id='and_then.v' class='invisible'><code>fn <a href='#method.and_then' class='fnname'>and_then</a>&lt;F, U&gt;(self, f: F) -&gt; <a class="struct" href="../../futures/stream/struct.AndThen.html" title="struct futures::stream::AndThen">AndThen</a>&lt;Self, F, U&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>) -&gt; U,<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&lt;Error = Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>Chain on a computation for when a value is ready, passing the successful
results to the provided closure <code>f</code>.</p>
<p>This function can be used to run a unit of work when the next successful
value on a stream is ready. The closure provided will be yielded a value
when ready, and the returned future will then be run to completion to
produce the next value on this stream.</p>
<p>Any errors produced by this stream will not be passed to the closure,
and will be passed through.</p>
<p>The returned value of the closure must implement the <code>IntoFuture</code> trait
and can represent some more work to be done before the composed stream
is finished. Note that the <code>Result</code> type implements the <code>IntoFuture</code>
trait so it is possible to simply alter the <code>Result</code> yielded to the
closure and return it.</p>
<p>Note that this function consumes the receiving stream and returns a
wrapped version of it.</p>
<h1 id="examples-6" class="section-header"><a href="#examples-6">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">futures</span>::<span class="ident">stream</span>::<span class="kw-2">*</span>;
<span class="kw">use</span> <span class="ident">futures</span>::<span class="ident">sync</span>::<span class="ident">mpsc</span>;

<span class="kw">let</span> (<span class="ident">_tx</span>, <span class="ident">rx</span>) <span class="op">=</span> <span class="ident">mpsc</span>::<span class="ident">channel</span>::<span class="op">&lt;</span><span class="ident">i32</span><span class="op">&gt;</span>(<span class="number">1</span>);

<span class="kw">let</span> <span class="ident">rx</span> <span class="op">=</span> <span class="ident">rx</span>.<span class="ident">and_then</span>(<span class="op">|</span><span class="ident">result</span><span class="op">|</span> {
    <span class="kw">if</span> <span class="ident">result</span> <span class="op">%</span> <span class="number">2</span> <span class="op">==</span> <span class="number">0</span> {
        <span class="prelude-val">Ok</span>(<span class="ident">result</span>)
    } <span class="kw">else</span> {
        <span class="prelude-val">Err</span>(())
    }
});</pre>
</div><h3 id='method.or_else' class='method'><span id='or_else.v' class='invisible'><code>fn <a href='#method.or_else' class='fnname'>or_else</a>&lt;F, U&gt;(self, f: F) -&gt; <a class="struct" href="../../futures/stream/struct.OrElse.html" title="struct futures::stream::OrElse">OrElse</a>&lt;Self, F, U&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>) -&gt; U,<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&lt;Item = Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>Chain on a computation for when an error happens, passing the
erroneous result to the provided closure <code>f</code>.</p>
<p>This function can be used to run a unit of work and attempt to recover from
an error if one happens. The closure provided will be yielded an error
when one appears, and the returned future will then be run to completion
to produce the next value on this stream.</p>
<p>Any successful values produced by this stream will not be passed to the
closure, and will be passed through.</p>
<p>The returned value of the closure must implement the <code>IntoFuture</code> trait
and can represent some more work to be done before the composed stream
is finished. Note that the <code>Result</code> type implements the <code>IntoFuture</code>
trait so it is possible to simply alter the <code>Result</code> yielded to the
closure and return it.</p>
<p>Note that this function consumes the receiving stream and returns a
wrapped version of it.</p>
</div><h3 id='method.collect' class='method'><span id='collect.v' class='invisible'><code>fn <a href='#method.collect' class='fnname'>collect</a>(self) -&gt; <a class="struct" href="../../futures/stream/struct.Collect.html" title="struct futures::stream::Collect">Collect</a>&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>Collect all of the values of this stream into a vector, returning a
future representing the result of that computation.</p>
<p>This combinator will collect all successful results of this stream and
collect them into a <code>Vec&lt;Self::Item&gt;</code>. If an error happens then all
collected elements will be dropped and the error will be returned.</p>
<p>The returned future will be resolved whenever an error happens or when
the stream returns <code>Ok(None)</code>.</p>
<p>This method is only available when the <code>use_std</code> feature of this
library is activated, and it is activated by default.</p>
<h1 id="examples-7" class="section-header"><a href="#examples-7">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">thread</span>;

<span class="kw">use</span> <span class="ident">futures</span>::{<span class="ident">Stream</span>, <span class="ident">Future</span>, <span class="ident">Sink</span>};
<span class="kw">use</span> <span class="ident">futures</span>::<span class="ident">sync</span>::<span class="ident">mpsc</span>;

<span class="kw">let</span> (<span class="kw-2">mut</span> <span class="ident">tx</span>, <span class="ident">rx</span>) <span class="op">=</span> <span class="ident">mpsc</span>::<span class="ident">channel</span>(<span class="number">1</span>);

<span class="ident">thread</span>::<span class="ident">spawn</span>(<span class="op">||</span> {
    <span class="kw">for</span> <span class="ident">i</span> <span class="kw">in</span> (<span class="number">0</span>..<span class="number">5</span>).<span class="ident">rev</span>() {
        <span class="ident">tx</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">send</span>(<span class="ident">i</span> <span class="op">+</span> <span class="number">1</span>).<span class="ident">wait</span>().<span class="ident">unwrap</span>();
    }
});

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">rx</span>.<span class="ident">collect</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</span>.<span class="ident">wait</span>(), <span class="prelude-val">Ok</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="number">5</span>, <span class="number">4</span>, <span class="number">3</span>, <span class="number">2</span>, <span class="number">1</span>]));</pre>
</div><h3 id='method.concat2' class='method'><span id='concat2.v' class='invisible'><code>fn <a href='#method.concat2' class='fnname'>concat2</a>(self) -&gt; <a class="struct" href="../../futures/stream/struct.Concat2.html" title="struct futures::stream::Concat2">Concat2</a>&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.Extend.html" title="trait core::iter::traits::Extend">Extend</a>&lt;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>::<a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html" title="trait core::iter::traits::IntoIterator">Item</a>&gt; + <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html" title="trait core::iter::traits::IntoIterator">IntoIterator</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>Concatenate all results of a stream into a single extendable
destination, returning a future representing the end result.</p>
<p>This combinator will extend the first item with the contents
of all the successful results of the stream. If the stream is
empty, the default value will be returned. If an error occurs,
all the results will be dropped and the error will be returned.</p>
<p>The name <code>concat2</code> is an intermediate measure until the release of
futures 0.2, at which point it will be renamed back to <code>concat</code>.</p>
<h1 id="examples-8" class="section-header"><a href="#examples-8">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">thread</span>;

<span class="kw">use</span> <span class="ident">futures</span>::{<span class="ident">Future</span>, <span class="ident">Sink</span>, <span class="ident">Stream</span>};
<span class="kw">use</span> <span class="ident">futures</span>::<span class="ident">sync</span>::<span class="ident">mpsc</span>;

<span class="kw">let</span> (<span class="kw-2">mut</span> <span class="ident">tx</span>, <span class="ident">rx</span>) <span class="op">=</span> <span class="ident">mpsc</span>::<span class="ident">channel</span>(<span class="number">1</span>);

<span class="ident">thread</span>::<span class="ident">spawn</span>(<span class="kw">move</span> <span class="op">||</span> {
    <span class="kw">for</span> <span class="ident">i</span> <span class="kw">in</span> (<span class="number">0</span>..<span class="number">3</span>).<span class="ident">rev</span>() {
        <span class="kw">let</span> <span class="ident">n</span> <span class="op">=</span> <span class="ident">i</span> <span class="op">*</span> <span class="number">3</span>;
        <span class="ident">tx</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">send</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="ident">n</span> <span class="op">+</span> <span class="number">1</span>, <span class="ident">n</span> <span class="op">+</span> <span class="number">2</span>, <span class="ident">n</span> <span class="op">+</span> <span class="number">3</span>]).<span class="ident">wait</span>().<span class="ident">unwrap</span>();
    }
});
<span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">rx</span>.<span class="ident">concat2</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</span>.<span class="ident">wait</span>(), <span class="prelude-val">Ok</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="number">7</span>, <span class="number">8</span>, <span class="number">9</span>, <span class="number">4</span>, <span class="number">5</span>, <span class="number">6</span>, <span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>]));</pre>
</div><h3 id='method.concat' class='method'><span id='concat.v' class='invisible'><code>fn <a href='#method.concat' class='fnname'>concat</a>(self) -&gt; <a class="struct" href="../../futures/stream/struct.Concat.html" title="struct futures::stream::Concat">Concat</a>&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.Extend.html" title="trait core::iter::traits::Extend">Extend</a>&lt;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>::<a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html" title="trait core::iter::traits::IntoIterator">Item</a>&gt; + <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html" title="trait core::iter::traits::IntoIterator">IntoIterator</a>,&nbsp;</span></code></span></h3><div class='stability'><div class='stab deprecated'>Deprecated since 0.1.14<p>: please use <code>Stream::concat2</code> instead</p>
</div></div><div class='docblock'><p>Concatenate all results of a stream into a single extendable
destination, returning a future representing the end result.</p>
<p>This combinator will extend the first item with the contents
of all the successful results of the stream. If an error occurs,
all the results will be dropped and the error will be returned.</p>
<h1 id="examples-9" class="section-header"><a href="#examples-9">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">thread</span>;

<span class="kw">use</span> <span class="ident">futures</span>::{<span class="ident">Future</span>, <span class="ident">Sink</span>, <span class="ident">Stream</span>};
<span class="kw">use</span> <span class="ident">futures</span>::<span class="ident">sync</span>::<span class="ident">mpsc</span>;

<span class="kw">let</span> (<span class="kw-2">mut</span> <span class="ident">tx</span>, <span class="ident">rx</span>) <span class="op">=</span> <span class="ident">mpsc</span>::<span class="ident">channel</span>(<span class="number">1</span>);

<span class="ident">thread</span>::<span class="ident">spawn</span>(<span class="kw">move</span> <span class="op">||</span> {
    <span class="kw">for</span> <span class="ident">i</span> <span class="kw">in</span> (<span class="number">0</span>..<span class="number">3</span>).<span class="ident">rev</span>() {
        <span class="kw">let</span> <span class="ident">n</span> <span class="op">=</span> <span class="ident">i</span> <span class="op">*</span> <span class="number">3</span>;
        <span class="ident">tx</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">send</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="ident">n</span> <span class="op">+</span> <span class="number">1</span>, <span class="ident">n</span> <span class="op">+</span> <span class="number">2</span>, <span class="ident">n</span> <span class="op">+</span> <span class="number">3</span>]).<span class="ident">wait</span>().<span class="ident">unwrap</span>();
    }
});
<span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">rx</span>.<span class="ident">concat</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</span>.<span class="ident">wait</span>(), <span class="prelude-val">Ok</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="number">7</span>, <span class="number">8</span>, <span class="number">9</span>, <span class="number">4</span>, <span class="number">5</span>, <span class="number">6</span>, <span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>]));</pre>
<h1 id="panics-2" class="section-header"><a href="#panics-2">Panics</a></h1>
<p>It's important to note that this function will panic if the stream
is empty, which is the reason for its deprecation.</p>
</div><h3 id='method.fold' class='method'><span id='fold.v' class='invisible'><code>fn <a href='#method.fold' class='fnname'>fold</a>&lt;F, T, Fut&gt;(self, init: T, f: F) -&gt; <a class="struct" href="../../futures/stream/struct.Fold.html" title="struct futures::stream::Fold">Fold</a>&lt;Self, F, Fut, T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(T, Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>) -&gt; Fut,<br>&nbsp;&nbsp;&nbsp;&nbsp;Fut: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&lt;Item = T&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;Fut::<a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">Error</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>Execute an accumulating computation over a stream, collecting all the
values into one final result.</p>
<p>This combinator will collect all successful results of this stream
according to the closure provided. The initial state is also provided to
this method and then is returned again by each execution of the closure.
Once the entire stream has been exhausted the returned future will
resolve to this value.</p>
<p>If an error happens then collected state will be dropped and the error
will be returned.</p>
<h1 id="examples-10" class="section-header"><a href="#examples-10">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">futures</span>::<span class="ident">stream</span>::{<span class="self">self</span>, <span class="ident">Stream</span>};
<span class="kw">use</span> <span class="ident">futures</span>::<span class="ident">future</span>::{<span class="ident">ok</span>, <span class="ident">Future</span>};

<span class="kw">let</span> <span class="ident">number_stream</span> <span class="op">=</span> <span class="ident">stream</span>::<span class="ident">iter</span>::<span class="op">&lt;</span>_, _, ()<span class="op">&gt;</span>((<span class="number">0</span>..<span class="number">6</span>).<span class="ident">map</span>(<span class="prelude-val">Ok</span>));
<span class="kw">let</span> <span class="ident">sum</span> <span class="op">=</span> <span class="ident">number_stream</span>.<span class="ident">fold</span>(<span class="number">0</span>, <span class="op">|</span><span class="ident">acc</span>, <span class="ident">x</span><span class="op">|</span> <span class="ident">ok</span>(<span class="ident">acc</span> <span class="op">+</span> <span class="ident">x</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">sum</span>.<span class="ident">wait</span>(), <span class="prelude-val">Ok</span>(<span class="number">15</span>));</pre>
</div><h3 id='method.flatten' class='method'><span id='flatten.v' class='invisible'><code>fn <a href='#method.flatten' class='fnname'>flatten</a>(self) -&gt; <a class="struct" href="../../futures/stream/struct.Flatten.html" title="struct futures::stream::Flatten">Flatten</a>&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>Flattens a stream of streams into just one continuous stream.</p>
<p>If this stream's elements are themselves streams then this combinator
will flatten out the entire stream to one long chain of elements. Any
errors are passed through without looking at them, but otherwise each
individual stream will get exhausted before moving on to the next.</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">thread</span>;

<span class="kw">use</span> <span class="ident">futures</span>::{<span class="ident">Future</span>, <span class="ident">Stream</span>, <span class="ident">Poll</span>, <span class="ident">Sink</span>};
<span class="kw">use</span> <span class="ident">futures</span>::<span class="ident">sync</span>::<span class="ident">mpsc</span>;

<span class="kw">let</span> (<span class="ident">tx1</span>, <span class="ident">rx1</span>) <span class="op">=</span> <span class="ident">mpsc</span>::<span class="ident">channel</span>::<span class="op">&lt;</span><span class="ident">i32</span><span class="op">&gt;</span>(<span class="number">1</span>);
<span class="kw">let</span> (<span class="ident">tx2</span>, <span class="ident">rx2</span>) <span class="op">=</span> <span class="ident">mpsc</span>::<span class="ident">channel</span>::<span class="op">&lt;</span><span class="ident">i32</span><span class="op">&gt;</span>(<span class="number">1</span>);
<span class="kw">let</span> (<span class="ident">tx3</span>, <span class="ident">rx3</span>) <span class="op">=</span> <span class="ident">mpsc</span>::<span class="ident">channel</span>(<span class="number">1</span>);

<span class="ident">thread</span>::<span class="ident">spawn</span>(<span class="op">||</span> {
    <span class="ident">tx1</span>.<span class="ident">send</span>(<span class="number">1</span>).<span class="ident">wait</span>().<span class="ident">unwrap</span>()
       .<span class="ident">send</span>(<span class="number">2</span>).<span class="ident">wait</span>().<span class="ident">unwrap</span>();
});
<span class="ident">thread</span>::<span class="ident">spawn</span>(<span class="op">||</span> {
    <span class="ident">tx2</span>.<span class="ident">send</span>(<span class="number">3</span>).<span class="ident">wait</span>().<span class="ident">unwrap</span>()
       .<span class="ident">send</span>(<span class="number">4</span>).<span class="ident">wait</span>().<span class="ident">unwrap</span>();
});
<span class="ident">thread</span>::<span class="ident">spawn</span>(<span class="op">||</span> {
    <span class="ident">tx3</span>.<span class="ident">send</span>(<span class="ident">rx1</span>).<span class="ident">wait</span>().<span class="ident">unwrap</span>()
       .<span class="ident">send</span>(<span class="ident">rx2</span>).<span class="ident">wait</span>().<span class="ident">unwrap</span>();
});

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">rx3</span>.<span class="ident">flatten</span>().<span class="ident">collect</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result</span>.<span class="ident">wait</span>(), <span class="prelude-val">Ok</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>]));</pre>
</div><h3 id='method.skip_while' class='method'><span id='skip_while.v' class='invisible'><code>fn <a href='#method.skip_while' class='fnname'>skip_while</a>&lt;P, R&gt;(self, pred: P) -&gt; <a class="struct" href="../../futures/stream/struct.SkipWhile.html" title="struct futures::stream::SkipWhile">SkipWhile</a>&lt;Self, P, R&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(&amp;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>) -&gt; R,<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, Error = Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>Skip elements on this stream while the predicate provided resolves to
<code>true</code>.</p>
<p>This function, like <code>Iterator::skip_while</code>, will skip elements on the
stream until the <code>predicate</code> resolves to <code>false</code>. Once one element
returns false all future elements will be returned from the underlying
stream.</p>
</div><h3 id='method.take_while' class='method'><span id='take_while.v' class='invisible'><code>fn <a href='#method.take_while' class='fnname'>take_while</a>&lt;P, R&gt;(self, pred: P) -&gt; <a class="struct" href="../../futures/stream/struct.TakeWhile.html" title="struct futures::stream::TakeWhile">TakeWhile</a>&lt;Self, P, R&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(&amp;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>) -&gt; R,<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, Error = Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>Take elements from this stream while the predicate provided resolves to
<code>true</code>.</p>
<p>This function, like <code>Iterator::take_while</code>, will take elements from the
stream until the <code>predicate</code> resolves to <code>false</code>. Once one element
returns false it will always return that the stream is done.</p>
</div><h3 id='method.for_each' class='method'><span id='for_each.v' class='invisible'><code>fn <a href='#method.for_each' class='fnname'>for_each</a>&lt;F, U&gt;(self, f: F) -&gt; <a class="struct" href="../../futures/stream/struct.ForEach.html" title="struct futures::stream::ForEach">ForEach</a>&lt;Self, F, U&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>) -&gt; U,<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">()</a>, Error = Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>Runs this stream to completion, executing the provided closure for each
element on the stream.</p>
<p>The closure provided will be called for each item this stream resolves
to successfully, producing a future. That future will then be executed
to completion before moving on to the next item.</p>
<p>The returned value is a <code>Future</code> where the <code>Item</code> type is <code>()</code> and
errors are otherwise threaded through. Any error on the stream or in the
closure will cause iteration to be halted immediately and the future
will resolve to that error.</p>
</div><h3 id='method.from_err' class='method'><span id='from_err.v' class='invisible'><code>fn <a href='#method.from_err' class='fnname'>from_err</a>&lt;E:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;&gt;(self) -&gt; <a class="struct" href="../../futures/stream/struct.FromErr.html" title="struct futures::stream::FromErr">FromErr</a>&lt;Self, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>Map this stream's error to any error implementing <code>From</code> for
this stream's <code>Error</code>, returning a new stream.</p>
<p>This function does for streams what <code>try!</code> does for <code>Result</code>,
by letting the compiler infer the type of the resulting error.
Just as <code>map_err</code> above, this is useful for example to ensure
that streams have the same error type when used with
combinators.</p>
<p>Note that this function consumes the receiving stream and returns a
wrapped version of it.</p>
</div><h3 id='method.take' class='method'><span id='take.v' class='invisible'><code>fn <a href='#method.take' class='fnname'>take</a>(self, amt: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -&gt; <a class="struct" href="../../futures/stream/struct.Take.html" title="struct futures::stream::Take">Take</a>&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>Creates a new stream of at most <code>amt</code> items of the underlying stream.</p>
<p>Once <code>amt</code> items have been yielded from this stream then it will always
return that the stream is done.</p>
<h1 id="errors-1" class="section-header"><a href="#errors-1">Errors</a></h1>
<p>Any errors yielded from underlying stream, before the desired amount of
items is reached, are passed through and do not affect the total number
of items taken.</p>
</div><h3 id='method.skip' class='method'><span id='skip.v' class='invisible'><code>fn <a href='#method.skip' class='fnname'>skip</a>(self, amt: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -&gt; <a class="struct" href="../../futures/stream/struct.Skip.html" title="struct futures::stream::Skip">Skip</a>&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>Creates a new stream which skips <code>amt</code> items of the underlying stream.</p>
<p>Once <code>amt</code> items have been skipped from this stream then it will always
return the remaining items on this stream.</p>
<h1 id="errors-2" class="section-header"><a href="#errors-2">Errors</a></h1>
<p>All errors yielded from underlying stream are passed through and do not
affect the total number of items skipped.</p>
</div><h3 id='method.fuse' class='method'><span id='fuse.v' class='invisible'><code>fn <a href='#method.fuse' class='fnname'>fuse</a>(self) -&gt; <a class="struct" href="../../futures/stream/struct.Fuse.html" title="struct futures::stream::Fuse">Fuse</a>&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>Fuse a stream such that <code>poll</code> will never again be called once it has
finished.</p>
<p>Currently once a stream has returned <code>None</code> from <code>poll</code> any further
calls could exhibit bad behavior such as block forever, panic, never
return, etc. If it is known that <code>poll</code> may be called after stream has
already finished, then this method can be used to ensure that it has
defined semantics.</p>
<p>Once a stream has been <code>fuse</code>d and it finishes, then it will forever
return <code>None</code> from <code>poll</code>. This, unlike for the traits <code>poll</code> method,
is guaranteed.</p>
<p>Also note that as soon as this stream returns <code>None</code> it will be dropped
to reclaim resources associated with it.</p>
</div><h3 id='method.by_ref' class='method'><span id='by_ref.v' class='invisible'><code>fn <a href='#method.by_ref' class='fnname'>by_ref</a>(&amp;mut self) -&gt; &amp;mut Self <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>Borrows a stream, rather than consuming it.</p>
<p>This is useful to allow applying stream adaptors while still retaining
ownership of the original stream.</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">futures</span>::<span class="ident">future</span>::{<span class="ident">ok</span>, <span class="ident">Future</span>};
<span class="kw">use</span> <span class="ident">futures</span>::<span class="ident">stream</span>::{<span class="self">self</span>, <span class="ident">Stream</span>};

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">stream</span> <span class="op">=</span> <span class="ident">stream</span>::<span class="ident">iter</span>::<span class="op">&lt;</span>_, _, ()<span class="op">&gt;</span>((<span class="number">1</span>..<span class="number">5</span>).<span class="ident">map</span>(<span class="prelude-val">Ok</span>));

<span class="kw">let</span> <span class="ident">sum</span> <span class="op">=</span> <span class="ident">stream</span>.<span class="ident">by_ref</span>().<span class="ident">take</span>(<span class="number">2</span>).<span class="ident">fold</span>(<span class="number">0</span>, <span class="op">|</span><span class="ident">a</span>, <span class="ident">b</span><span class="op">|</span> <span class="ident">ok</span>(<span class="ident">a</span> <span class="op">+</span> <span class="ident">b</span>)).<span class="ident">wait</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">sum</span>, <span class="prelude-val">Ok</span>(<span class="number">3</span>));

<span class="comment">// You can use the stream again</span>
<span class="kw">let</span> <span class="ident">sum</span> <span class="op">=</span> <span class="ident">stream</span>.<span class="ident">take</span>(<span class="number">2</span>).<span class="ident">fold</span>(<span class="number">0</span>, <span class="op">|</span><span class="ident">a</span>, <span class="ident">b</span><span class="op">|</span> <span class="ident">ok</span>(<span class="ident">a</span> <span class="op">+</span> <span class="ident">b</span>)).<span class="ident">wait</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">sum</span>, <span class="prelude-val">Ok</span>(<span class="number">7</span>));</pre>
</div><h3 id='method.catch_unwind' class='method'><span id='catch_unwind.v' class='invisible'><code>fn <a href='#method.catch_unwind' class='fnname'>catch_unwind</a>(self) -&gt; <a class="struct" href="../../futures/stream/struct.CatchUnwind.html" title="struct futures::stream::CatchUnwind">CatchUnwind</a>&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>Catches unwinding panics while polling the stream.</p>
<p>Caught panic (if any) will be the last element of the resulting stream.</p>
<p>In general, panics within a stream can propagate all the way out to the
task level. This combinator makes it possible to halt unwinding within
the stream itself. It's most commonly used within task executors. This
method should not be used for error handling.</p>
<p>Note that this method requires the <code>UnwindSafe</code> bound from the standard
library. This isn't always applied automatically, and the standard
library provides an <code>AssertUnwindSafe</code> wrapper type to apply it
after-the fact. To assist using this method, the <code>Stream</code> trait is also
implemented for <code>AssertUnwindSafe&lt;S&gt;</code> where <code>S</code> implements <code>Stream</code>.</p>
<p>This method is only available when the <code>use_std</code> feature of this
library is activated, and it is activated by default.</p>
<h1 id="examples-11" class="section-header"><a href="#examples-11">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">futures</span>::<span class="ident">stream</span>;
<span class="kw">use</span> <span class="ident">futures</span>::<span class="ident">stream</span>::<span class="ident">Stream</span>;

<span class="kw">let</span> <span class="ident">stream</span> <span class="op">=</span> <span class="ident">stream</span>::<span class="ident">iter</span>::<span class="op">&lt;</span>_, <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">i32</span><span class="op">&gt;</span>, <span class="ident">bool</span><span class="op">&gt;</span>(<span class="macro">vec</span><span class="macro">!</span>[
    <span class="prelude-val">Some</span>(<span class="number">10</span>), <span class="prelude-val">None</span>, <span class="prelude-val">Some</span>(<span class="number">11</span>)].<span class="ident">into_iter</span>().<span class="ident">map</span>(<span class="prelude-val">Ok</span>));
<span class="comment">// panic on second element</span>
<span class="kw">let</span> <span class="ident">stream_panicking</span> <span class="op">=</span> <span class="ident">stream</span>.<span class="ident">map</span>(<span class="op">|</span><span class="ident">o</span><span class="op">|</span> <span class="ident">o</span>.<span class="ident">unwrap</span>());
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">iter</span> <span class="op">=</span> <span class="ident">stream_panicking</span>.<span class="ident">catch_unwind</span>().<span class="ident">wait</span>();

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="prelude-val">Ok</span>(<span class="number">10</span>), <span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>().<span class="ident">ok</span>().<span class="ident">unwrap</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>().<span class="ident">is_err</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">iter</span>.<span class="ident">next</span>().<span class="ident">is_none</span>());</pre>
</div><h3 id='method.buffered' class='method'><span id='buffered.v' class='invisible'><code>fn <a href='#method.buffered' class='fnname'>buffered</a>(self, amt: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="../../futures/stream/struct.Buffered.html" title="struct futures::stream::Buffered">Buffered</a>&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&lt;Error = Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>An adaptor for creating a buffered list of pending futures.</p>
<p>If this stream's item can be converted into a future, then this adaptor
will buffer up to at most <code>amt</code> futures and then return results in the
same order as the underlying stream. No more than <code>amt</code> futures will be
buffered at any point in time, and less than <code>amt</code> may also be buffered
depending on the state of each future.</p>
<p>The returned stream will be a stream of each future's result, with
errors passed through whenever they occur.</p>
<p>This method is only available when the <code>use_std</code> feature of this
library is activated, and it is activated by default.</p>
</div><h3 id='method.buffer_unordered' class='method'><span id='buffer_unordered.v' class='invisible'><code>fn <a href='#method.buffer_unordered' class='fnname'>buffer_unordered</a>(self, amt: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="../../futures/stream/struct.BufferUnordered.html" title="struct futures::stream::BufferUnordered">BufferUnordered</a>&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&lt;Error = Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>An adaptor for creating a buffered list of pending futures (unordered).</p>
<p>If this stream's item can be converted into a future, then this adaptor
will buffer up to <code>amt</code> futures and then return results in the order
in which they complete. No more than <code>amt</code> futures will be buffered at
any point in time, and less than <code>amt</code> may also be buffered depending on
the state of each future.</p>
<p>The returned stream will be a stream of each future's result, with
errors passed through whenever they occur.</p>
<p>This method is only available when the <code>use_std</code> feature of this
library is activated, and it is activated by default.</p>
</div><h3 id='method.merge' class='method'><span id='merge.v' class='invisible'><code>fn <a href='#method.merge' class='fnname'>merge</a>&lt;S&gt;(self, other: S) -&gt; <a class="struct" href="../../futures/stream/struct.Merge.html" title="struct futures::stream::Merge">Merge</a>&lt;Self, S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>&lt;Error = Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>An adapter for merging the output of two streams.</p>
<p>The merged stream produces items from one or both of the underlying
streams as they become available. Errors, however, are not merged: you
get at most one error at a time.</p>
</div><h3 id='method.zip' class='method'><span id='zip.v' class='invisible'><code>fn <a href='#method.zip' class='fnname'>zip</a>&lt;S&gt;(self, other: S) -&gt; <a class="struct" href="../../futures/stream/struct.Zip.html" title="struct futures::stream::Zip">Zip</a>&lt;Self, S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>&lt;Error = Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>An adapter for zipping two streams together.</p>
<p>The zipped stream waits for both streams to produce an item, and then
returns that pair. If an error happens, then that error will be returned
immediately. If either stream ends then the zipped stream will also end.</p>
</div><h3 id='method.chain' class='method'><span id='chain.v' class='invisible'><code>fn <a href='#method.chain' class='fnname'>chain</a>&lt;S&gt;(self, other: S) -&gt; <a class="struct" href="../../futures/stream/struct.Chain.html" title="struct futures::stream::Chain">Chain</a>&lt;Self, S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>&lt;Item = Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>, Error = Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>Adapter for chaining two stream.</p>
<p>The resulting stream emits elements from the first stream, and when
first stream reaches the end, emits the elements from the second stream.</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">futures</span>::<span class="ident">stream</span>;
<span class="kw">use</span> <span class="ident">futures</span>::<span class="ident">stream</span>::<span class="ident">Stream</span>;

<span class="kw">let</span> <span class="ident">stream1</span> <span class="op">=</span> <span class="ident">stream</span>::<span class="ident">iter</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="prelude-val">Ok</span>(<span class="number">10</span>), <span class="prelude-val">Err</span>(<span class="bool-val">false</span>)]);
<span class="kw">let</span> <span class="ident">stream2</span> <span class="op">=</span> <span class="ident">stream</span>::<span class="ident">iter</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="prelude-val">Err</span>(<span class="bool-val">true</span>), <span class="prelude-val">Ok</span>(<span class="number">20</span>)]);
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">chain</span> <span class="op">=</span> <span class="ident">stream1</span>.<span class="ident">chain</span>(<span class="ident">stream2</span>).<span class="ident">wait</span>();

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="prelude-val">Some</span>(<span class="prelude-val">Ok</span>(<span class="number">10</span>)), <span class="ident">chain</span>.<span class="ident">next</span>());
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="prelude-val">Some</span>(<span class="prelude-val">Err</span>(<span class="bool-val">false</span>)), <span class="ident">chain</span>.<span class="ident">next</span>());
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="prelude-val">Some</span>(<span class="prelude-val">Err</span>(<span class="bool-val">true</span>)), <span class="ident">chain</span>.<span class="ident">next</span>());
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="prelude-val">Some</span>(<span class="prelude-val">Ok</span>(<span class="number">20</span>)), <span class="ident">chain</span>.<span class="ident">next</span>());
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="prelude-val">None</span>, <span class="ident">chain</span>.<span class="ident">next</span>());</pre>
</div><h3 id='method.peekable' class='method'><span id='peekable.v' class='invisible'><code>fn <a href='#method.peekable' class='fnname'>peekable</a>(self) -&gt; <a class="struct" href="../../futures/stream/struct.Peekable.html" title="struct futures::stream::Peekable">Peekable</a>&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>Creates a new stream which exposes a <code>peek</code> method.</p>
<p>Calling <code>peek</code> returns a reference to the next item in the stream.</p>
</div><h3 id='method.chunks' class='method'><span id='chunks.v' class='invisible'><code>fn <a href='#method.chunks' class='fnname'>chunks</a>(self, capacity: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="../../futures/stream/struct.Chunks.html" title="struct futures::stream::Chunks">Chunks</a>&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>An adaptor for chunking up items of the stream inside a vector.</p>
<p>This combinator will attempt to pull items from this stream and buffer
them into a local vector. At most <code>capacity</code> items will get buffered
before they're yielded from the returned stream.</p>
<p>Note that the vectors returned from this iterator may not always have
<code>capacity</code> elements. If the underlying stream ended and only a partial
vector was created, it'll be returned. Additionally if an error happens
from the underlying stream then the currently buffered items will be
yielded.</p>
<p>Errors are passed through the stream unbuffered.</p>
<p>This method is only available when the <code>use_std</code> feature of this
library is activated, and it is activated by default.</p>
<h1 id="panics-3" class="section-header"><a href="#panics-3">Panics</a></h1>
<p>This method will panic of <code>capacity</code> is zero.</p>
</div><h3 id='method.select' class='method'><span id='select.v' class='invisible'><code>fn <a href='#method.select' class='fnname'>select</a>&lt;S&gt;(self, other: S) -&gt; <a class="struct" href="../../futures/stream/struct.Select.html" title="struct futures::stream::Select">Select</a>&lt;Self, S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>&lt;Item = Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>, Error = Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>Creates a stream that selects the next element from either this stream
or the provided one, whichever is ready first.</p>
<p>This combinator will attempt to pull items from both streams. Each
stream will be polled in a round-robin fashion, and whenever a stream is
ready to yield an item that item is yielded.</p>
<p>The <code>select</code> function is similar to <code>merge</code> except that it requires both
streams to have the same item and error types.</p>
<p>Error are passed through from either stream.</p>
</div><h3 id='method.forward' class='method'><span id='forward.v' class='invisible'><code>fn <a href='#method.forward' class='fnname'>forward</a>&lt;S&gt;(self, sink: S) -&gt; <a class="struct" href="../../futures/stream/struct.Forward.html" title="struct futures::stream::Forward">Forward</a>&lt;Self, S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a>&lt;SinkItem = Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;S::<a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">SinkError</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>A future that completes after the given stream has been fully processed
into the sink, including flushing.</p>
<p>This future will drive the stream to keep producing items until it is
exhausted, sending each item to the sink. It will complete once both the
stream is exhausted, and the sink has fully processed received item,
flushed successfully, and closed successfully.</p>
<p>Doing <code>stream.forward(sink)</code> is roughly equivalent to
<code>sink.send_all(stream)</code>. The returned future will exhaust all items from
<code>self</code>, sending them all to <code>sink</code>. Furthermore the <code>sink</code> will be
closed and flushed.</p>
<p>On completion, the pair <code>(stream, sink)</code> is returned.</p>
</div><h3 id='method.split' class='method'><span id='split.v' class='invisible'><code>fn <a href='#method.split' class='fnname'>split</a>(self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="../../futures/stream/struct.SplitSink.html" title="struct futures::stream::SplitSink">SplitSink</a>&lt;Self&gt;, <a class="struct" href="../../futures/stream/struct.SplitStream.html" title="struct futures::stream::SplitStream">SplitStream</a>&lt;Self&gt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>Splits this <code>Stream + Sink</code> object into separate <code>Stream</code> and <code>Sink</code>
objects.</p>
<p>This can be useful when you want to split ownership between tasks, or
allow direct interaction between the two objects (e.g. via
<code>Sink::send_all</code>).</p>
<p>This method is only available when the <code>use_std</code> feature of this
library is activated, and it is activated by default.</p>
</div></div>
        <h2 id='implementors'>Implementors</h2>
        <ul class='item-list' id='implementors-list'>
    <li><code>impl&lt;F&gt; Stream for <a class="struct" href="../../futures/future/struct.FlattenStream.html" title="struct futures::future::FlattenStream">FlattenStream</a>&lt;F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;F::<a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Item</a>: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>&lt;Error = F::<a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Error</a>&gt;,&nbsp;</span></code></li>
<li><code>impl&lt;F:&nbsp;<a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a>&gt; Stream for <a class="struct" href="../../futures/future/struct.IntoStream.html" title="struct futures::future::IntoStream">IntoStream</a>&lt;F&gt;</code></li>
<li><code>impl&lt;I, T, E&gt; Stream for <a class="struct" href="../../futures/stream/struct.Iter.html" title="struct futures::stream::Iter">Iter</a>&lt;I&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a>&lt;Item = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, E&gt;&gt;,&nbsp;</span></code></li>
<li><code>impl&lt;T, E&gt; Stream for <a class="struct" href="../../futures/stream/struct.Repeat.html" title="struct futures::stream::Repeat">Repeat</a>&lt;T, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,&nbsp;</span></code></li>
<li><code>impl&lt;S, F, U&gt; Stream for <a class="struct" href="../../futures/stream/struct.AndThen.html" title="struct futures::stream::AndThen">AndThen</a>&lt;S, F, U&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(S::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>) -&gt; U,<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&lt;Error = S::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,&nbsp;</span></code></li>
<li><code>impl&lt;S1, S2&gt; Stream for <a class="struct" href="../../futures/stream/struct.Chain.html" title="struct futures::stream::Chain">Chain</a>&lt;S1, S2&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S1: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;S2: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>&lt;Item = S1::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>, Error = S1::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,&nbsp;</span></code></li>
<li><code>impl&lt;T, E&gt; Stream for <a class="struct" href="../../futures/stream/struct.Empty.html" title="struct futures::stream::Empty">Empty</a>&lt;T, E&gt;</code></li>
<li><code>impl&lt;S, F&gt; Stream for <a class="struct" href="../../futures/stream/struct.Filter.html" title="struct futures::stream::Filter">Filter</a>&lt;S, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(&amp;S::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,&nbsp;</span></code></li>
<li><code>impl&lt;S, F, B&gt; Stream for <a class="struct" href="../../futures/stream/struct.FilterMap.html" title="struct futures::stream::FilterMap">FilterMap</a>&lt;S, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(S::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;B&gt;,&nbsp;</span></code></li>
<li><code>impl&lt;S&gt; Stream for <a class="struct" href="../../futures/stream/struct.Flatten.html" title="struct futures::stream::Flatten">Flatten</a>&lt;S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;S::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;S::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;S::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,&nbsp;</span></code></li>
<li><code>impl&lt;S:&nbsp;<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>, E:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;S::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;&gt; Stream for <a class="struct" href="../../futures/stream/struct.FromErr.html" title="struct futures::stream::FromErr">FromErr</a>&lt;S, E&gt;</code></li>
<li><code>impl&lt;S:&nbsp;<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>&gt; Stream for <a class="struct" href="../../futures/stream/struct.Fuse.html" title="struct futures::stream::Fuse">Fuse</a>&lt;S&gt;</code></li>
<li><code>impl&lt;S, F, U&gt; Stream for <a class="struct" href="../../futures/stream/struct.Map.html" title="struct futures::stream::Map">Map</a>&lt;S, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(S::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>) -&gt; U,&nbsp;</span></code></li>
<li><code>impl&lt;S, F, U&gt; Stream for <a class="struct" href="../../futures/stream/struct.MapErr.html" title="struct futures::stream::MapErr">MapErr</a>&lt;S, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(S::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>) -&gt; U,&nbsp;</span></code></li>
<li><code>impl&lt;S1, S2&gt; Stream for <a class="struct" href="../../futures/stream/struct.Merge.html" title="struct futures::stream::Merge">Merge</a>&lt;S1, S2&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S1: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;S2: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>&lt;Error = S1::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,&nbsp;</span></code></li>
<li><code>impl&lt;T, E&gt; Stream for <a class="struct" href="../../futures/stream/struct.Once.html" title="struct futures::stream::Once">Once</a>&lt;T, E&gt;</code></li>
<li><code>impl&lt;S, F, U&gt; Stream for <a class="struct" href="../../futures/stream/struct.OrElse.html" title="struct futures::stream::OrElse">OrElse</a>&lt;S, F, U&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(S::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>) -&gt; U,<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&lt;Item = S::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>&gt;,&nbsp;</span></code></li>
<li><code>impl&lt;S:&nbsp;<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>&gt; Stream for <a class="struct" href="../../futures/stream/struct.Peekable.html" title="struct futures::stream::Peekable">Peekable</a>&lt;S&gt;</code></li>
<li><code>impl&lt;S1, S2&gt; Stream for <a class="struct" href="../../futures/stream/struct.Select.html" title="struct futures::stream::Select">Select</a>&lt;S1, S2&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S1: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;S2: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>&lt;Item = S1::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>, Error = S1::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,&nbsp;</span></code></li>
<li><code>impl&lt;S&gt; Stream for <a class="struct" href="../../futures/stream/struct.Skip.html" title="struct futures::stream::Skip">Skip</a>&lt;S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>,&nbsp;</span></code></li>
<li><code>impl&lt;S, P, R&gt; Stream for <a class="struct" href="../../futures/stream/struct.SkipWhile.html" title="struct futures::stream::SkipWhile">SkipWhile</a>&lt;S, P, R&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(&amp;S::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>) -&gt; R,<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, Error = S::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,&nbsp;</span></code></li>
<li><code>impl&lt;S&gt; Stream for <a class="struct" href="../../futures/stream/struct.Take.html" title="struct futures::stream::Take">Take</a>&lt;S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>,&nbsp;</span></code></li>
<li><code>impl&lt;S, P, R&gt; Stream for <a class="struct" href="../../futures/stream/struct.TakeWhile.html" title="struct futures::stream::TakeWhile">TakeWhile</a>&lt;S, P, R&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(&amp;S::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>) -&gt; R,<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, Error = S::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,&nbsp;</span></code></li>
<li><code>impl&lt;S, F, U&gt; Stream for <a class="struct" href="../../futures/stream/struct.Then.html" title="struct futures::stream::Then">Then</a>&lt;S, F, U&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;S::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>, S::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;) -&gt; U,<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>,&nbsp;</span></code></li>
<li><code>impl&lt;T, F, Fut, It&gt; Stream for <a class="struct" href="../../futures/stream/struct.Unfold.html" title="struct futures::stream::Unfold">Unfold</a>&lt;T, F, Fut&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(T) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Fut&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Fut: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>It, T<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>&gt;,&nbsp;</span></code></li>
<li><code>impl&lt;S1, S2&gt; Stream for <a class="struct" href="../../futures/stream/struct.Zip.html" title="struct futures::stream::Zip">Zip</a>&lt;S1, S2&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S1: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;S2: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>&lt;Error = S1::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,&nbsp;</span></code></li>
<li><code>impl&lt;S&gt; Stream for <a class="struct" href="../../futures/stream/struct.Buffered.html" title="struct futures::stream::Buffered">Buffered</a>&lt;S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;S::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&lt;Error = S::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,&nbsp;</span></code></li>
<li><code>impl&lt;S&gt; Stream for <a class="struct" href="../../futures/stream/struct.BufferUnordered.html" title="struct futures::stream::BufferUnordered">BufferUnordered</a>&lt;S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;S::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Item</a>: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&lt;Error = S::<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Error</a>&gt;,&nbsp;</span></code></li>
<li><code>impl&lt;S&gt; Stream for <a class="struct" href="../../futures/stream/struct.CatchUnwind.html" title="struct futures::stream::CatchUnwind">CatchUnwind</a>&lt;S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a>,&nbsp;</span></code></li>
<li><code>impl&lt;S:&nbsp;<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>&gt; Stream for <a class="struct" href="https://doc.rust-lang.org/nightly/std/panic/struct.AssertUnwindSafe.html" title="struct std::panic::AssertUnwindSafe">AssertUnwindSafe</a>&lt;S&gt;</code></li>
<li><code>impl&lt;S&gt; Stream for <a class="struct" href="../../futures/stream/struct.Chunks.html" title="struct futures::stream::Chunks">Chunks</a>&lt;S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>,&nbsp;</span></code></li>
<li><code>impl&lt;S:&nbsp;<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>&gt; Stream for <a class="struct" href="../../futures/stream/struct.SplitStream.html" title="struct futures::stream::SplitStream">SplitStream</a>&lt;S&gt;</code></li>
<li><code>impl&lt;T&gt; Stream for <a class="struct" href="../../futures/stream/struct.FuturesUnordered.html" title="struct futures::stream::FuturesUnordered">FuturesUnordered</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a>,&nbsp;</span></code></li>
<li><code>impl&lt;S:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>&gt; Stream for <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;S&gt;</code></li>
<li><code>impl&lt;'a, S:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>&gt; Stream for &amp;'a mut S</code></li>
<li><code>impl&lt;S, U, F, Fut&gt; Stream for <a class="struct" href="../../futures/sink/struct.With.html" title="struct futures::sink::With">With</a>&lt;S, U, F, Fut&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a> + <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html" title="trait core::ops::FnMut">FnMut</a>(U) -&gt; Fut,<br>&nbsp;&nbsp;&nbsp;&nbsp;Fut: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>,&nbsp;</span></code></li>
<li><code>impl&lt;S:&nbsp;<a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>, E&gt; Stream for <a class="struct" href="../../futures/sink/struct.SinkFromErr.html" title="struct futures::sink::SinkFromErr">SinkFromErr</a>&lt;S, E&gt;</code></li>
<li><code>impl&lt;S&gt; Stream for <a class="struct" href="../../futures/sink/struct.Buffer.html" title="struct futures::sink::Buffer">Buffer</a>&lt;S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a> + <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>,&nbsp;</span></code></li>
<li><code>impl&lt;T&gt; Stream for futures::sync::mpsc::<a class="struct" href="../../futures/sync/mpsc/struct.Receiver.html" title="struct futures::sync::mpsc::Receiver">Receiver</a>&lt;T&gt;</code></li>
<li><code>impl&lt;T&gt; Stream for futures::sync::mpsc::<a class="struct" href="../../futures/sync/mpsc/struct.UnboundedReceiver.html" title="struct futures::sync::mpsc::UnboundedReceiver">UnboundedReceiver</a>&lt;T&gt;</code></li>
<li><code>impl&lt;T&gt; Stream for futures::unsync::mpsc::<a class="struct" href="../../futures/unsync/mpsc/struct.Receiver.html" title="struct futures::unsync::mpsc::Receiver">Receiver</a>&lt;T&gt;</code></li>
<li><code>impl&lt;T&gt; Stream for futures::unsync::mpsc::<a class="struct" href="../../futures/unsync/mpsc/struct.UnboundedReceiver.html" title="struct futures::unsync::mpsc::UnboundedReceiver">UnboundedReceiver</a>&lt;T&gt;</code></li>
</ul><script type="text/javascript" async
                         src="../../implementors/futures/stream/trait.Stream.js">
                 </script></section>
    <section id='search' class="content hidden"></section>

    <section class="footer"></section>

    <aside id="help" class="hidden">
        <div>
            <h1 class="hidden">Help</h1>

            <div class="shortcuts">
                <h2>Keyboard Shortcuts</h2>

                <dl>
                    <dt>?</dt>
                    <dd>Show this help dialog</dd>
                    <dt>S</dt>
                    <dd>Focus the search field</dd>
                    <dt>&larrb;</dt>
                    <dd>Move up in search results</dd>
                    <dt>&rarrb;</dt>
                    <dd>Move down in search results</dd>
                    <dt>&#9166;</dt>
                    <dd>Go to active search result</dd>
                    <dt>+</dt>
                    <dd>Collapse/expand all sections</dd>
                </dl>
            </div>

            <div class="infos">
                <h2>Search Tricks</h2>

                <p>
                    Prefix searches with a type followed by a colon (e.g.
                    <code>fn:</code>) to restrict the search to a given type.
                </p>

                <p>
                    Accepted types are: <code>fn</code>, <code>mod</code>,
                    <code>struct</code>, <code>enum</code>,
                    <code>trait</code>, <code>type</code>, <code>macro</code>,
                    and <code>const</code>.
                </p>

                <p>
                    Search functions by type signature (e.g.
                    <code>vec -> usize</code> or <code>* -> vec</code>)
                </p>
            </div>
        </div>
    </aside>

    

    <script>
        window.rootPath = "../../";
        window.currentCrate = "futures";
    </script>
    <script src="../../jquery.js"></script>
    <script src="../../main.js"></script>
    <script defer src="../../search-index.js"></script>
</body>
</html>