YieldResult
The result of a call to yield(_:)
.
- iOS
- 13+
- macOS
- 10.15+
- tvOS
- 13+
- watchOS
- 6+
enum YieldResult
The result of a call to yield(_:)
.
enum YieldResult
s7NIOCore32NIOThrowingAsyncSequenceProducerV6SourceV11YieldResultO
What are these?9JNE1
import NIOCore
The core abstractions that make up SwiftNIO.
struct Source
A struct to interface between the synchronous code of the producer and the asynchronous consumer. This type allows the producer to synchronously yield
new elements to the NIOThrowingAsyncSequenceProducer
and to finish
the sequence.
struct NIOThrowingAsyncSequenceProducer<Element, Failure, Strategy, Delegate> where Element : Sendable, Failure : Error, Strategy : NIOAsyncSequenceProducerBackPressureStrategy, Delegate : NIOAsyncSequenceProducerDelegate
This is an AsyncSequence
that supports a unicast AsyncIterator
.
func yield(_ element: Element) -> YieldResult
Yields a new elements to the NIOThrowingAsyncSequenceProducer
.
case produceMore
Indicates that the caller should produce more elements.
case stopProducing
Indicates that the caller should stop producing elements.
case dropped
Indicates that the yielded elements have been dropped because the sequence already terminated.
func finish()
Finishes the sequence.
func finish(_ failure: Failure)
Finishes the sequence with the given Failure
.
func yield<S>(contentsOf sequence: S) -> YieldResult where Element == S.Element, S : Sequence
Yields a sequence of new elements to the NIOThrowingAsyncSequenceProducer
.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.