isErrAnd method

  1. @override
  2. @useResult
bool isErrAnd(
  1. bool condition(
    1. E error
    )
)
override

Returns true if this is an Err with a contained error that satisfies condition.

Examples

// prints "false"
print(const Ok<int, String>(2).isErrAnd((value) => value == 'error'));

// prints "true"
print(const Err<int, String>('error').isErrAnd((value) => value == 'error'));

Implementation

@override
@useResult
bool isErrAnd(bool Function(E error) condition) => false;