File tree 2 files changed +24
-0
lines changed
2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ use crate :: stream:: Stream ;
2
+
3
+ use std:: pin:: Pin ;
4
+ use std:: task:: { Context , Poll } ;
5
+
6
+ /// An stream able to yield elements from both ends.
7
+ ///
8
+ /// Something that implements `DoubleEndedStream` has one extra capability
9
+ /// over something that implements [`Stream`]: the ability to also take
10
+ /// `Item`s from the back, as well as the front.
11
+ ///
12
+ /// [`Stream`]: trait.Stream.html
13
+ pub trait DoubleEndedStream : Stream {
14
+ /// Removes and returns an element from the end of the stream.
15
+ ///
16
+ /// Returns `None` when there are no more elements.
17
+ ///
18
+ /// The [trait-level] docs contain more details.
19
+ ///
20
+ /// [trait-level]: trait.DoubleEndedStream.html
21
+ fn poll_next_back ( self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Option < Self :: Item > > ;
22
+ }
Original file line number Diff line number Diff line change @@ -25,8 +25,10 @@ pub use empty::{empty, Empty};
25
25
pub use once:: { once, Once } ;
26
26
pub use repeat:: { repeat, Repeat } ;
27
27
pub use stream:: { Stream , Take } ;
28
+ pub use double_ended_stream:: DoubleEndedStream ;
28
29
29
30
mod empty;
30
31
mod once;
31
32
mod repeat;
32
33
mod stream;
34
+ mod double_ended_stream;
You can’t perform that action at this time.
0 commit comments