mapOrElse<U> method

U mapOrElse<U>(
  1. U ok(
    1. T
    ),
  2. U err(
    1. E
    )
)

Maps a Result<T, E> to U by applying ok to a contained value or err to a contained error.

Implementation

U mapOrElse<U>(U Function(T) ok, U Function(E) err) =>
    isOk ? ok(_value) : err(_error);