Instance Method

count()

Publishes the number of elements received from the upstream publisher.

Declaration

func count() -> Publishers.Count<Publishers.Output<Upstream>>

Return Value

A publisher that consumes all elements until the upstream publisher finishes, then emits a single value with the total number of elements received.