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. Adebitalways has an implicit amount of1.
Declaration
Swift
public enum Transaction<Time> : Equatable where Time : Strideable, Time.Stride : SchedulerTimeIntervalConvertibleextension DemandLedger.Transaction: CustomDebugStringConvertible -
Initializes an empty
DemandLedgerDeclaration
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
View on GitHub
DemandLedger Structure Reference