mapErr<U> method

  1. @override
Result<T, U> mapErr<U>(
  1. U f(
    1. E error
    )
)
override

Maps a Result<T, E> to Result<T, F> by applying a function to a contained Err value, leaving an Ok value untouched.

This function can be used to pass through a successful result while handling an error.

@param f a function to apply to the error Err value

Implementation

@override
Result<T, U> mapErr<U>(U Function(E error) f) => ok(this.value);