Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

method libtmux-swift latest

ControlNotificationStream.allSatisfy(_:)

Returns a Boolean value that indicates whether all elements produced by the asynchronous sequence satisfy the given predicate.

Source and package
Qualified name
ControlNotificationStream.allSatisfy(_:)
Declared in
ControlNotificationStream
Package
libtmux-swift
allSatisfy(predicate: (Self.Element) async throws -> Bool) -> Bool

Inherited from AsyncSequence.allSatisfy(_:)

Description#

In this example, an asynchronous sequence called Counter produces Int values from 1 to 10. The allSatisfy(_:) method checks to see whether all elements produced by the sequence are less than 10.

let allLessThanTen = await Counter(howHigh: 10) .allSatisfy { $0 < 10 } print(allLessThanTen) // Prints "false"

The predicate executes each time the asynchronous sequence produces an element, until either the predicate returns false or the sequence ends.

If the asynchronous sequence is empty, this method returns true.

  • Parameter predicate: A closure that takes an element of the asynchronous sequence as its argument and returns a Boolean value that indicates whether the passed element satisfies a condition.
  • Returns: true if the sequence contains only elements that satisfy predicate; otherwise, false.
Parameters
Raises
  • any Error – Conditionally propagates errors (rethrows).

Esc

Type to search.

Reference previewOpen reference