isSomeAnd method

bool isSomeAnd(
  1. bool predicate(
    1. T
    )
)

Returns whether or not this Option holds a value (Some) and the held value matches the given predicate.

Returns:

  • true if this Option is Some and predicate returns true.
  • false if this Option is None, or predicate returns false

See also: Rust: Option::is_some_and()

Implementation

bool isSomeAnd(bool Function(T) predicate) => switch (this) {
	Some(value: T value) => predicate(value),
	None() => false
};