Open conorbros opened 2 years ago
Hah! Fun question. There's no quota accessor on rate-limiters yet, because i haven't found a need for one so far (if you want to provide information to a user being rate-limited, check out the StateInformationMiddleware
!)...
I think some janky ways exist to get at a StateSnapshot
without the state information middleware, but if all you need is just the literal quota - I guess a thing that works like StateSnapshot::quota
would be a great addition. I can probably add this later this week, or I'm happy to apply a PR you submit if you get to it first!
Essentially I want to do this. It's a simple example that doesn't account for the other possible constructors for
Quota
.