fn map_err<E, F>(self, f: F) -> MapErr<Self, F>
    where
        F: FnOnce(Self::Error) -> E,
        Self: Sized,
    {
        assert_future::<Result<Self::Ok, E>, _>(MapErr::new(self, f))
    }
Maps this future's error value to a different value.

This method can be used to change the [`Error`](TryFuture::Error) type
of the future into a different type. It is similar to the
[`Result::map_err`] method. You can use this method for example to
ensure that futures have the same [`Error`](TryFuture::Error) type when
using [`select!`] or [`join!`].

The provided closure `f` will only be called if this future is resolved
to an [`Err`]. If it resolves to an [`Ok`], panics, or is dropped, then
the provided closure will never be invoked.

Note that this method consumes the future it is called on and returns a
wrapped version of it.

# Examples

```
use futures::future::TryFutureExt;

# futures::executor::block_on(async {
let future = async { Err::<i32, i32>(1) };
let future = future.map_err(|x| x + 3);
assert_eq!(future.await, Err(4));
# });
```

Calling [`map_err`](TryFutureExt::map_err) on a successful future has
no effect:

```
use futures::future::TryFutureExt;

# futures::executor::block_on(async {
let future = async { Ok::<i32, i32>(1) };
let future = future.map_err(|x| x + 3);
assert_eq!(future.await, Ok(1));
# });
```

[`join!`]: crate::join
[`select!`]: crate::select
futures-util/src/future/try_future/mod.rs