Instance Methodswift 6.0.1_Concurrency
next
Produces the next element in the compact map sequence.
- iOS
- 13.0+
- macOS
- 10.15+
- tvOS
- 13.0+
- watchOS
- 6.0+
mutating func next() async throws -> ElementOfResult?
This iterator calls next()
on its base iterator; if this call returns nil
, next()
returns nil
. Otherwise, next()
calls the transforming closure on the received element, returning it if the transform returns a non-nil
value. If the transform returns nil
, this method continues to wait for further elements until it gets one that transforms to a non-nil
value. If calling the closure throws an error, the sequence ends and next()
rethrows the error.
Other members in extension
Typealiases
Instance members
func next(isolation: isolated (any Actor)?
) async throws -> ElementOfResult? Produces the next element in the compact map sequence.