File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 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};
2525pub use once:: { once, Once } ;
2626pub use repeat:: { repeat, Repeat } ;
2727pub use stream:: { Stream , Take } ;
28+ pub use double_ended_stream:: DoubleEndedStream ;
2829
2930mod empty;
3031mod once;
3132mod repeat;
3233mod stream;
34+ mod double_ended_stream;
You can’t perform that action at this time.
0 commit comments