isOkAnd method

bool isOkAnd(
  1. bool predicate(
    1. T
    )
)

Returns whether or not this Result is Ok and that the held value matches the given predicate.

Returns:

  • true if this Result is Ok and predicate returns true.
  • false if this Result is Err, or predicate returns false

See also: Rust: Result::is_ok_and()

Implementation

bool isOkAnd(bool Function(T) predicate) => switch (this) {
	Ok(value: T value) => predicate(value),
	Err() => false
};