WindowReading

class WindowReading(val remaining: Int, val resetIn: Duration?)(source)

What a server said about one window after it counted a call: remaining calls left (may be negative once the server is over its limit) and, when it said, resetIn until the window resets.

Stable Core. Equality is on both properties; toString() prints them.

Parameters

remaining

the calls the server says are left after it counted the call; may be negative.

resetIn

how long until the window resets, or null when the server did not say; not negative.

Throws

Constructors

Link copied to clipboard
constructor(remaining: Int, resetIn: Duration?)
constructor(remaining: Int)

A reading without a reset time.

Properties

Link copied to clipboard

The calls the server says are left after it counted the call; may be negative.

Link copied to clipboard

How long until the window resets, or null when the server did not say. Not negative.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Two WindowReadings are equal when their remaining and resetIn are equal.

Link copied to clipboard
open override fun hashCode(): Int

Returns a hash code consistent with equals: it is computed from the same properties.

Link copied to clipboard
open override fun toString(): String

A diagnostic string for logs: remaining and resetIn. Its format is not part of the API and may change.