PackageTrack
Sign in Get early access

governor

A rate-limiting implementation in Rust

0.10.4 72M downloads/mo #981 most downloaded on crates.io boinkor-net/governor

What this package is like to depend on

Last release 8 months ago

16 Dec 2025

Ships fairly regularly

a new release about every 3 months

Most releases are documented

notes for 21 of 24 stable releases

1 version withdrawn

withdrawn after publishing

7 years old

25 releases · first in 2019

3 releases in the last 12 months

see the full history below

Release timeline

25 releases · Nov 2019 to Dec 2025
2020 2021 2022 2023 2024 2025 2026
Release Pre-release Withdrawn

Releases

latest 25
  1. 0.10.4 16 Dec 2025
    Release notes

    Merge pull request #291 from boinkor-net/release/governor/0.10.4

    release: governor v0.10.4

    Open source →
    Release notes

    Another bug-fix release to repair the documentation build on docs.rs for good: The doc_auto_cfg feature was deprecated, this version switches to the feature doc_cfg.

    Open source →
  2. 0.10.3 16 Dec 2025
    Release notes

    Merge pull request #289 from boinkor-net/release/governor/0.10.3

    release: governor v0.10.3

    Open source →
    Release notes
    • Fixed a typo that prevented docs for 0.10.2 from building on docs.rs (#288). Thanks, @sp1ff!
    Open source →
  3. 0.10.2 13 Nov 2025
    Release notes

    Merge pull request #283 from boinkor-net/release/governor/0.10.2

    release: governor v0.10.2

    Open source →
    Release notes
    • Updated the hashbrown dependency to require version 0.16. Thanks, @cratelyn!
    Open source →
  4. 0.10.1 06 Aug 2025
    Release notes

    Merge pull request #278 from boinkor-net/release/governor/0.10.1

    release: governor v0.10.1

    Open source →
    Release notes
    • Updated code and tests to pass on nightly rust.
    Open source →
  5. 0.10.0 27 Mar 2025
    Release notes

    Merge pull request #267 from boinkor-net/release/governor/0.10.0

    release: governor v0.10.0

    Open source →
  6. 0.9.0 24 Mar 2025
    Release notes

    Merge pull request #265 from boinkor-net/release/governor/0.9.0

    release: governor v0.9.0

    Open source →
  7. 0.8.1 25 Feb 2025
    Release notes

    Merge pull request #261 from boinkor-net/release/governor/0.8.1

    release: governor v0.8.1

    Open source →
  8. 0.8.0 10 Dec 2024
    Release notes

    Merge pull request #253 from boinkor-net/release/governor/0.8.0

    release: governor v0.8.0

    Open source →
    Release notes

    Changed

    • Fixed the long-standing confusion of rate-limiting "tolerance" vs. "burst capacity": Tolerance is indicated with one cell less than burst capacity would be. The code treated the two as the same thing, leading to spurious single cells being allowed through when the clock advanced. (#107, #249). This confusion has finally been identified and fixed by @jonasmalacofilho in #251.

      This should not affect the public API, but any clients subject to rate-limiting may see a slightly fairer treatment.

    Contributors

    Open source →
  9. 0.7.0 21 Oct 2024
    Release notes

    Merge pull request #248 from boinkor-net/release/governor/0.7.0

    release: governor v0.7.0

    Open source →
    Release notes

    This is a quick bug-fix release to address the semver incompatibility in 0.6.4. It is functionally identical to 0.6.4, with the exception of the dashmap version upgrade.

    Changed

    • Upgraded dashmap to 6.1.0.
    Open source →
  10. 0.6.4 19 Oct 2024 withdrawn
    Release notes

    Merge pull request #243 from boinkor-net/release/governor/0.6.4

    release: governor v0.6.4

    Open source →
    Release notes

    This release has been yanked because it violates Semantic Versioning ideals: The Clock argument type in functions like direct_with_clock changed, which breaks existing code.

    Instead of 0.6.4, please use 0.7.0.

    Added

    • https://docs.rs/governor now lists the features required for feature-gated types and functions.

    • A RateLimiter now has a clock method to retrieve the clock providing its timestamps. Added by @max-heller in #232.

    Changed

    Open source →
  11. 0.6.3 16 Feb 2024
    Release notes

    Changed

    • Just another bug-fixed release process. This time, it should actually release out of github actions.
    Open source →
  12. 0.6.1 16 Feb 2024
    Release notes

    Changed

    • The governor repo now lives in the boinkor-net github organization. No ownership has changed (@antifuchs still manages this org), but this makes it easier to securely manage the CI and release setup.

    • The .per_second constructor for Quota now constructs a quota that ensures all rate-limiting calls succeed when given values in excess of 1 billion (previously, this would result in rate limiters that would incorrectly reject values). Reported in #203.

    • QuantaUpkeepInstant now properly advances forward.

    • no_std is now properly supported: Instead of parking-lot, governor now uses the spinning_top crate in no_std mode.

    Contributors

    Open source →
  13. 0.6.0 12 Jul 2023
    Release notes

    Added

    • Type aliases DefaultDirectRateLimiter and DefaultKeyedRateLimiter to cut down on type-typing of typical rate limiters in struct and function definitions. Requested in #85.

    Changed

    • The API for .check_n and .until_n (and their keyed counterpart) have changed to return a nested Result - the outer indicating whether the check could ever succeed and the inner one indicating the rate limiting result, if it could succeed.
    • Updated the quanta dependency to 0.11.1. This change also adds a reference u64 instant to all instances of the QuantaUpkeepClock structure. All lower-resolution quanta timekeeping used by governor will now be relative to that reference instant.
    • Some parts of the documentation for burst sizes has been rephrased to be less confusing.

    Contributors

    Open source →
  14. 0.5.1 29 Nov 2022
    Release notes

    Changed

    • Fixed quota reporting for positive rate limiting decisions when StateInformationMiddleware is in use with a real clock. Reported in #157

    Contributors

    Open source →
  15. 0.5.0 19 Sep 2022
    Release notes

    Changed

    • Fixed a bug in StateSnapshot::remaining_burst_capacity: Now returns the correct number of cells after enough time has passed. Thanks to @holmesmr for reporting #102!

    • Dropped a From<(&_ Gcra, Nanos)> impl for StateSnapshot.

    Open source →
  16. 0.4.2 09 Feb 2022
    Release notes

    Changed

    Internal

    Open source →
  17. 0.4.1 21 Jan 2022
    Release notes

    Changed

    Contributors

    Open source →
  18. 0.4.0 28 Dec 2021
    Release notes

    Added

    • You can now alter&expand the information returned from a rate limiter by attaching middleware to it using .with_middleware::<YourClass>() at construction time.

      This is an incompatible change, as the type signature of RateLimiter gained an additional generic parameter. See the pull request and issue #66 for details.

    Changed

    • Updated the Arc guide section to use Arc::clone() instead of limiter.clone().
    • Updated the quanta dependency to 0.8.0, speeding up the quanta clock by a bit. This changes the upkeep clock interface incompatibly: The quanta upkeep Builder structure got renamed to quanta::Upkeep.
    • The nanos module is now public, allowing other crates to implement the Clock trait.
    • When using the std feature, governor will no longer pull in the hashbrown crate.

    Contributors

    Open source →
  19. 0.3.2 28 Jan 2021

    Nothing published for this version

  20. 0.3.1 26 Jul 2020
    Release notes

    Added

    • A little section to the guide explaining how to use keyed rate limiters.

    Changed

    Several dependencies' minimum versions were bumped, including a version bump of smallvec, a transitive dependency which could previously result in trees using governor pulling in a vulnerable smallvec version.

    Contributors

    Open source →
  21. 0.3.0 25 Jul 2020
    Release notes

    Added

    • The ShrinkableKeyedStateStore trait now has required len and is_empty methods, which are also made available on any RateLimiter that uses a shrinkable (Hashmap / Dashmap backed) state store. Thanks to @lytefast for the idea and pull request on ratelimit_meter!

    Changed

    • The MonotonicClock and SystemClock struct definitions now are proper "empty" structs. Any non-Default construction of these clocks must now use MonotonicClock instead of MonotonicClock().
    • The clock::ReasonablyRealtime trait got simplified and no longer has any required methods to implement, only one default method.
    • Replaced the spin crate with parking_lot for no_std contexts.

    Contributors

    Open source →
  22. 0.2.0 01 Mar 2020
    Release notes

    Added

    • This changelog!

    • New type RateLimiter, superseding the DirectRateLimiter type.

    • Support for keyed rate limiting in RateLimiter, which allows users to keep a distict rate limit state based on the value of a hashable element.

    • Support for different state stores:

      • The direct in-memory state store
      • A keyed state store based on dashmap
      • A keyed state store based on a mutex-locked HashMap.
    • Support for different clock kinds:

      • Quanta (the default), a high-performance clock
      • Instant, the stdlib monotonic clock
      • A fake releative clock, useful for tests or in non-std environments.
    • Quota constructors now support a separate .allow_burst method that specifies a maximum burst capacity that diverges from the default.

    • New constructor Quota::with_period allows specifying the exact amount of time it takes to replenish a single element.

    Deprecated

    • The Quota::new constructor has some very confusing modalities, and should not be used as-is.

    Fixed

    • An off-by-one error in check_n, causing calls with n = burst_size + 1 to return a "not yet" result instead of a "this will never work" result.

    Contributors

    Open source →
  23. 0.1.2 17 Nov 2019
    Release notes

    Initial release: A "direct" (a single rate-limiting state per structure) rate limiter that works in an async context, using atomic operations.

    Open source →
  24. 0.1.1 15 Nov 2019

    Nothing published for this version

  25. 0.1.0 15 Nov 2019

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive