Event
@frozen
public enum Event<Element>
extension Event: CustomDebugStringConvertible
extension Event: EventConvertible
Represents a sequence event.
Sequence grammar: next* (error | completed)
-
Next element is produced.
Declaration
Swift
case next(Element) -
Sequence terminated with an error.
Declaration
Swift
case error(Swift.Error) -
Sequence completed successfully.
Declaration
Swift
case completed -
Description of event.
Declaration
Swift
public var debugDescription: String { get } -
If
nextevent, returns element value.Declaration
Swift
public var element: Element? { get } -
If
errorevent, returns error.Declaration
Swift
public var error: Swift.Error? { get } -
If
completedevent, returnstrue.Declaration
Swift
public var isCompleted: Bool { get } -
Maps sequence elements using transform. If error happens during the transform,
.errorwill be returned as value.Declaration
Swift
public func map<Result>(_ transform: (Element) throws -> Result) -> Event<Result> -
Event representation of this instance
Declaration
Swift
public var event: Event<Element> { get }
View on GitHub
Event Enumeration Reference