fn map_ok<T, F>(self, f: F) -> MapOk<Self, F>
    where
        Self: Sized,
        F: FnMut(Self::Ok) -> T,
    {
        assert_stream::<Result<T, Self::Error>, _>(MapOk::new(self, f))
    }
/// Wraps the current stream in a new stream which maps the success value
/// using the provided closure.
///
/// # Examples
///
/// ```
/// # futures::executor::block_on(async {
/// use futures::stream::{self, TryStreamExt};
///
/// let mut stream =
///     stream::iter(vec![Ok(5), Err(0)])
///         .map_ok(|x| x + 2);
///
/// assert_eq!(stream.try_next().await, Ok(Some(7)));
/// assert_eq!(stream.try_next().await, Err(0));
/// # })
/// ```
Wraps the current stream in a new stream which maps the success value
using the provided closure.
Wraps the current stream in a new stream which maps the success value using the provided closure .
fn map_ok<T, F>(self, f: F) -> MapOk<Self, F>
    where
        Self: Sized,
        F: FnMut(Self::Ok) -> T,
    {
        assert_stream::<Result<T, Self::Error>, _>(MapOk::new(self, f))
    }
fn map_ok < T , F > ( self , f : F ) -> MapOk < Self , F > where Self : Sized , F : FnMut ( Self :: Ok ) -> T , { assert_stream :: < Result < T , Self :: Error > , _ > ( MapOk :: new ( self , f ) ) }
Wraps the current stream in a new stream which maps the success value
using the provided closure.
Wraps the current stream in a new stream which maps the success value using the provided closure .
self
f
F
self
f
F
examples
None
futures::executor::block_on(async {
use futures::stream::{self, TryStreamExt}.



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