DemandLedger
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
public struct DemandLedger<Time> where Time : Strideable, Time.Stride : SchedulerTimeIntervalConvertible
extension DemandLedger: Sequence
extension DemandLedger: RangeReplaceableCollection
extension DemandLedger: ExpressibleByArrayLiteral
extension DemandLedger: Equatable
A sequence of Subscribers.Demand
transactions.
DemandLedger
‘s can be compared to see if they match expectations.
-
The kind of transcation for a
DemandLedger
.credit(amount:)
: The raise in authorized demand issued by aSubscriber
..debit(authorized:)
: The consumption of credit by an upstreamPublisher
. The debit is only considered authorised if the overall credit is greater or equal to the total debit over the lifetime of a subscription. Adebit
always has an implicit amount of1
.
Declaration
Swift
public enum Transaction<Time> : Equatable where Time : Strideable, Time.Stride : SchedulerTimeIntervalConvertible
extension DemandLedger.Transaction: CustomDebugStringConvertible
-
Initializes an empty
DemandLedger
Declaration
Swift
public init()
-
Declaration
Swift
public typealias Iterator = IndexingIterator<[Element]>
-
Declaration
Swift
public typealias Element = (VirtualTime, Subscribers.Demand, Transaction<Time>)
-
Declaration
Swift
public func makeIterator() -> IndexingIterator<[Element]>
-
Declaration
Swift
public static func == (lhs: DemandLedger<Time>, rhs: DemandLedger<Time>) -> Bool