Publish on crates.io?
dpc opened this issue · 4 comments
Hi,
I would like to use this library in my project. Basically I want a coupled/embedded rate limiter via in memory Store
.
But I can't find it on crates.io. Is there any reason for that?
BTW. Is there any reason why RateLimiter
doesn't just own Store
? It's not convenient if it requires a mutable reference, forcing to use crates like rental
and what not.
But I can't find it on crates.io. Is there any reason for that?
Not really — I just figured that it was not all that useful as a crate.
I've just published it now though. We may as well have it up there.
BTW. Is there any reason why
RateLimiter
doesn't just ownStore
? It's not convenient if it requires a mutable reference, forcing to use crates likerental
and what not.
If I understand the question correctly, it's so we can perform dependency injection. In tests, we can create a RateLimiter
and inject a TestStore
so that we don't need a real Redis dependency.
You can inject T: Store
, and not have to deal with lifetimes and such: dpc/ratelimit-gcra@378d5e1