fn try_next(&mut self) -> TryNext<'_, Self>
    where
        Self: Unpin,
    {
        assert_future::<Result<Option<Self::Ok>, Self::Error>, _>(TryNext::new(self))
    }
/// Creates a future that attempts to resolve the next item in the stream.
/// If an error is encountered before the next item, the error is returned
/// instead.
///
/// This is similar to the `Stream::next` combinator, but returns a
/// `Result<Option<T>, E>` rather than an `Option<Result<T, E>>`, making
/// for easy use with the `?` operator.
///
/// # Examples
///
/// ```
/// # futures::executor::block_on(async {
/// use futures::stream::{self, TryStreamExt};
///
/// let mut stream = stream::iter(vec![Ok(()), Err(())]);
///
/// assert_eq!(stream.try_next().await, Ok(Some(())));
/// assert_eq!(stream.try_next().await, Err(()));
/// # })
/// ```
Creates a future that attempts to resolve the next item in the stream.
If an error is encountered before the next item, the error is returned
instead.


Creates a future that attempts to resolve the next item in the stream . If an error is encountered before the next item the error is returned instead .
fn try_next(&mut self) -> TryNext<'_, Self>
    where
        Self: Unpin,
    {
        assert_future::<Result<Option<Self::Ok>, Self::Error>, _>(TryNext::new(self))
    }
fn try_next ( & mut self ) -> TryNext < ' _ , Self > where Self : Unpin , { assert_future :: < Result < Option < Self :: Ok > , Self :: Error > , _ > ( TryNext :: new ( self ) ) }
Creates a future that attempts to resolve the next item in the stream.
Creates a future that attempts to resolve the next item in the stream .
&mut self
&mut self
examples
None
futures::executor::block_on(async {
use futures::stream::{self, TryStreamExt}.



assert_eq!(stream.try_next().await, Ok(Some(())));
assert_eq!(stream.try_next().await, Err(())).
use futures :: stream :: { self TryStreamExt } . assert_eq! ( stream . try_next () . await Ok ( Some (( )))) ; assert_eq! ( stream . try_next () . await Err (( ))) .
})
None