Protocol

Cancellable

A protocol indicating that an activity or action supports cancellation.

Declaration

protocol Cancellable

Overview

Calling cancel() frees up any allocated resources. It also stops side effects such as timers, network access, or disk I/O.

Topics

Canceling Actions

func cancel()

Cancel the activity.

Required.

Storing Cancellable Instances

func store<C>(in: inout C)

Stores this cancellable instance in the specified collection.

func store(in: inout Set<AnyCancellable>)

Stores this cancellable instance in the specified set.

Relationships

Inherited By

See Also

Publishers

protocol Publisher

Declares that a type can transmit a sequence of values over time.

enum Publishers

A namespace for types that serve as publishers.

struct AnyPublisher

A type-erasing publisher.

protocol ConnectablePublisher

A publisher that provides an explicit means of connecting and canceling publication.

struct Published

A type that publishes a property marked with an attribute.

class AnyCancellable

A type-erasing cancellable object that executes a provided closure when canceled.