<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Combine",
  "identifier" : "/documentation/Combine/Subscribers/Demand",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Combine"
    ],
    "preciseIdentifier" : "s:7Combine11SubscribersO6DemandV"
  },
  "title" : "Subscribers.Demand"
}
-->

# Subscribers.Demand

A requested number of items, sent to a publisher from a subscriber through the subscription.

```
@frozen struct Demand
```

## Topics

### Creating a demand instance

[`max(_:)`](/documentation/Combine/Subscribers/Demand/max(_:))

Creates a demand for the given maximum number of elements.

### Using special demands

[`unlimited`](/documentation/Combine/Subscribers/Demand/unlimited)

A request for as many values as the publisher can produce.

[`none`](/documentation/Combine/Subscribers/Demand/none)

A request for no elements from the publisher.

### Inspecing demand properties

[`max`](/documentation/Combine/Subscribers/Demand/max)

The number of requested values.

### Encoding and decoding

[`encode(to:)`](/documentation/Combine/Subscribers/Demand/encode(to:))

Encodes the demand to the provide encoder.

[`init(from:)`](/documentation/Combine/Subscribers/Demand/init(from:))

Creates a demand instance from a decoder.

### Performing mathematical operations

[`*(_:_:)`](/documentation/Combine/Subscribers/Demand/*(_:_:))

Returns the result of multiplying a demand by an integer.

[`*=(_:_:)`](/documentation/Combine/Subscribers/Demand/*=(_:_:))

Multiplies a demand by an integer, and assigns the result to the demand.

[`+(_:_:)`](/documentation/Combine/Subscribers/Demand/+(_:_:)-2hdad)

Returns the result of adding two demands.
When adding any value to `.unlimited`, the result is `.unlimited`.

[`+(_:_:)`](/documentation/Combine/Subscribers/Demand/+(_:_:)-902we)

Returns the result of adding an integer to a demand.

[`+=(_:_:)`](/documentation/Combine/Subscribers/Demand/+=(_:_:)-20lis)

Adds two demands, and assigns the result to the first demand.

[`+=(_:_:)`](/documentation/Combine/Subscribers/Demand/+=(_:_:)-3k1hv)

Adds an integer to a demand, and assigns the result to the demand.

[`-(_:_:)`](/documentation/Combine/Subscribers/Demand/-(_:_:)-1r0gm)

Returns the result of subtracting one demand from another.

[`-(_:_:)`](/documentation/Combine/Subscribers/Demand/-(_:_:)-6mw4s)

Returns the result of subtracting an integer from a demand.

[`-=(_:_:)`](/documentation/Combine/Subscribers/Demand/-=(_:_:)-1d0m9)

Subtracts one demand from another, and assigns the result to the first demand.

[`-=(_:_:)`](/documentation/Combine/Subscribers/Demand/-=(_:_:)-9pwnc)

Subtracts an integer from a demand, and assigns the result to the demand.

### Comparing demands

[`==(_:_:)`](/documentation/Combine/Subscribers/Demand/==(_:_:)-4oy8i)

Returns a Boolean value that indicates whether a given number of elements matches the request of a given demand.

[`==(_:_:)`](/documentation/Combine/Subscribers/Demand/==(_:_:)-7246z)

Returns a Boolean value that indicates whether a demand requests the given number of elements.

[`!=(_:_:)`](/documentation/Combine/Subscribers/Demand/!=(_:_:)-3j2h8)

Returns a Boolean value that indicates whether an integer is unequal to a demand.

[`!=(_:_:)`](/documentation/Combine/Subscribers/Demand/!=(_:_:)-2dj1p)

Returns a Boolean value that indicates whether a demand isn’t equal to an integer.

[`<(_:_:)`](/documentation/Combine/Subscribers/Demand/_(_:_:)-1wuod)

Returns a Boolean that indicates a given number of elements is less than the maximum specified by the demand.

[`<(_:_:)`](/documentation/Combine/Subscribers/Demand/_(_:_:)-ciby)

Returns a Boolean that indicates whether the demand requests fewer than the given number of elements.

[`<(_:_:)`](/documentation/Combine/Subscribers/Demand/_(_:_:)-8nf1g)

Returns a Boolean that indicates whether the first demand requests fewer elements than the second.

[`<=(_:_:)`](/documentation/Combine/Subscribers/Demand/_=(_:_:)-5f62z)

Returns a Boolean value that indicates a given number of elements is less than or equal the maximum specified by the demand.

[`<=(_:_:)`](/documentation/Combine/Subscribers/Demand/_=(_:_:)-2otvi)

Returns a Boolean that indicates whether the demand requests fewer or the same number of elements as the given integer.

[`<=(_:_:)`](/documentation/Combine/Subscribers/Demand/_=(_:_:)-9cywv)

Returns a Boolean value that indicates whether the first demand requests fewer or the same number of elements as the second.

[`>(_:_:)`](/documentation/Combine/Subscribers/Demand/_(_:_:)-35p6f)

Returns a Boolean that indicates a given number of elements is greater than the maximum specified by the demand.

[`>(_:_:)`](/documentation/Combine/Subscribers/Demand/_(_:_:)-4k1xp)

Returns a Boolean that indicates whether the demand requests more than the given number of elements.

[`>(_:_:)`](/documentation/Combine/Subscribers/Demand/_(_:_:)-74yle)

Returns a Boolean that indicates whether the first demand requests more elements than the second.

[`>=(_:_:)`](/documentation/Combine/Subscribers/Demand/_=(_:_:)-6lv9s)

Returns a Boolean that indicates a given number of elements is greater than or equal to the maximum specified by the demand.

[`>=(_:_:)`](/documentation/Combine/Subscribers/Demand/_=(_:_:)-28c1e)

Returns a Boolean that indicates whether the first demand requests more or the same number of elements as the second.

[`>=(_:_:)`](/documentation/Combine/Subscribers/Demand/_=(_:_:)-5xnt)

Returns a Boolean that indicates whether the first demand requests more or the same number of elements as the second.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)