Termination
A type that indicates how the stream terminated.
- iOS
- 13.0+
- macOS
- 10.15+
- tvOS
- 13.0+
- watchOS
- 6.0+
enum TerminationThe onTermination closure receives an instance of this type.
A type that indicates how the stream terminated.
enum TerminationThe onTermination closure receives an instance of this type.
import _Concurrencystruct ContinuationA mechanism to interface between synchronous code and an asynchronous stream.
struct AsyncStream<Element>An asynchronous sequence generated from a closure that calls a continuation to produce new elements.
case cancelledThe stream finished as a result of cancellation.
case finishedThe stream finished as a result of calling the continuation’s finish method.
var onTermination: ((AsyncStream<Element>.Continuation.Termination) -> Void)? { get nonmutating set }A callback to invoke when canceling iteration of an asynchronous stream.
func finish() Resume the task awaiting the next iteration point by having it return nil, which signifies the end of the iteration.
@discardableResult func yield() -> AsyncStream<Element>.Continuation.YieldResult where Element == () Resume the task awaiting the next iteration point by having it return normally from its suspension point.
@discardableResult func yield(_ value: sending Element) -> AsyncStream<Element>.Continuation.YieldResult Resume the task awaiting the next iteration point by having it return normally from its suspension point with a given element.
@discardableResult func yield(with result: sending Result<Element, Never>) -> AsyncStream<Element>.Continuation.YieldResult Resume the task awaiting the next iteration point by having it return normally from its suspension point with a given result’s success value.
enum BufferingPolicyA strategy that handles exhaustion of a buffer’s capacity.
enum YieldResultA type that indicates the result of yielding a value to a client, by way of the continuation.
protocol EquatableA type that can be compared for value equality.
protocol Hashable : EquatableA type that can be hashed into a Hasher to produce an integer hash value.
protocol SendableA thread-safe type whose values can be shared across arbitrary concurrent contexts without introducing a risk of data races. Values of the type may have no shared mutable state, or they may protect that state with a lock or by forcing it to only be accessed from a specific actor.
static func != (lhs: Self, rhs: Self) -> Bool Returns a Boolean value indicating whether two values are not equal.