Skip to content

Commit

Permalink
Merge pull request #68 from dwrensha/stream-into-future-doc
Browse files Browse the repository at this point in the history
clarification about Stream::into_future()
  • Loading branch information
alexcrichton committed Aug 16, 2016
2 parents 6dfd2db + b796be8 commit f672963
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/stream/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,13 @@ pub trait Stream: 'static {

/// Converts this stream into a `Future`.
///
/// A stream can be viewed as simply a future which will resolve to the next
/// element of the stream as well as the stream itself. The returned future
/// can be used to compose streams and futures together by placing
/// everything into the "world of futures".
/// 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 `None` and the remaining stream is
/// still passed back, to allow reclamation of its resources.
///
/// The returned future can be used to compose streams and futures together by
/// placing everything into the "world of futures".
fn into_future(self) -> StreamFuture<Self>
where Self: Sized
{
Expand Down

0 comments on commit f672963

Please sign in to comment.