Generic Structure

AnySubscriber

A type-erasing subscriber.

Declaration

@frozen struct AnySubscriber<Input, Failure> where Failure : Error

Overview

Use an AnySubscriber to wrap an existing subscriber whose details you don’t want to expose. You can also use AnySubscriber to create a custom subscriber by providing closures for the methods defined in Subscriber, rather than implementing Subscriber directly.

Topics

Creating a Type-Erased Subscriber

init<S>(S)

Creates a type-erasing subscriber to wrap an existing subscriber.

Receiving Elements

func receive() -> Subscribers.Demand

Tells the subscriber that a publisher of void elements is ready to receive further requests.

Initializers

Instance Properties

var combineIdentifier: CombineIdentifier

See Also

Subscribers

protocol Subscriber

A protocol that declares a type that can receive input from a publisher.

enum Subscribers

A namespace for types that serve as subscribers.

protocol Subscription

A protocol representing the connection of a subscriber to a publisher.

enum Subscriptions

A namespace for symbols related to subscriptions.