fn chain<St>(self, other: St) -> Chain<Self, St>
    where
        St: Stream<Item = Self::Item>,
        Self: Sized,
    {
        assert_stream::<Self::Item, _>(Chain::new(self, other))
    }
/// Adapter for chaining two streams.
///
/// The resulting stream emits elements from the first stream, and when
/// first stream reaches the end, emits the elements from the second stream.
///
/// ```
/// # futures::executor::block_on(async {
/// use futures::stream::{self, StreamExt};
///
/// let stream1 = stream::iter(vec![Ok(10), Err(false)]);
/// let stream2 = stream::iter(vec![Err(true), Ok(20)]);
///
/// let stream = stream1.chain(stream2);
///
/// let result: Vec<_> = stream.collect().await;
/// assert_eq!(result, vec![
///     Ok(10),
///     Err(false),
///     Err(true),
///     Ok(20),
/// ]);
/// # });
/// ```
Adapter for chaining two streams.
The resulting stream emits elements from the first stream, and when
first stream reaches the end, emits the elements from the second stream.


Adapter for chaining two streams . The resulting stream emits elements from the first stream and when first stream reaches the end emits the elements from the second stream .
fn chain<St>(self, other: St) -> Chain<Self, St>
    where
        St: Stream<Item = Self::Item>,
        Self: Sized,
    {
        assert_stream::<Self::Item, _>(Chain::new(self, other))
    }
fn chain < St > ( self , other : St ) -> Chain < Self , St > where St : Stream < Item = Self :: Item > , Self : Sized , { assert_stream :: < Self :: Item , _ > ( Chain :: new ( self , other ) ) }
Adapter for chaining two streams.
Adapter for chaining two streams .
self
other
St
self
other
St
futures::executor::block_on(async {
use futures::stream::{self, StreamExt}.



let stream = stream1.chain(stream2).

let result: Vec<_> = stream.collect().await;
assert_eq!(result, vec![
Ok(10),
Err(false),
Err(true),
Ok(20),
]).
use futures :: stream :: { self StreamExt } . let stream = stream1 . chain ( stream2 ) . let result : Vec<_ > = stream . collect () . await ; assert_eq! ( result vec! [ Ok ( 10 ) Err ( false ) Err ( true ) Ok ( 20 ) ] ) .
});
None