contains abstract method

bool contains(
  1. Object? x
)

Returns true if the result is an Ok (success) value containing the given value.

Examples

Basic usage:

Result<int, String> x = Ok(2);
expect(x.contains(2), true);

Result<int, String> x = Ok(3);
expect(x.contains(2), false);

Result<int, String> x = Err('Some error message');
expect(x.contains(2), false);

Implementation

bool contains(Object? x);