match<W> method

  1. @override
W match<W>({
  1. required W ok(
    1. S
    ),
  2. required W err(
    1. F
    ),
})
override

Returns the result of ok for the encapsulated value if this instance represents Ok or the result of err function for the encapsulated value if it is Err.

Implementation

@override
@pragma("vm:prefer-inline")
W match<W>({required W Function(S) ok, required W Function(F) err}) {
  return err(this.err);
}