Skip to content

Rate Limiting as simple data structures. No async funny business.

License

Notifications You must be signed in to change notification settings

irrustible/simple-rate-limit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-rate-limit

License Package Documentation

#[test]
fn one_nanosecond() {
    let rl = RateLimit::new(1, Duration::from_nanos(1)).unwrap();
    let mut rler = RateLimiter::new(rl);
    let then = Instant::now();
    assert_eq!(rler.check_at(then), true);
    let now = then + Duration::from_nanos(2);
    assert_eq!(rler.check_at(now), true);
}

Status

Beta? Only has basic tests but seems to work.

Copyright and License

Copyright (c) 2020 James Laver, simple-rate-limit contributors.

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.

About

Rate Limiting as simple data structures. No async funny business.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages