match<R> method
R
match<R>({
- required R ok(
- T value
- required R err(
- E error
Pattern matches on the result, invoking ok or err accordingly.
Implementation
R match<R>({
required R Function(T value) ok,
required R Function(E error) err,
}) {
final self = this;
if (self is Ok<T, E>) return ok(self.value);
return err((self as Err<T, E>).error);
}