chore: checkpoint before Python removal

This commit is contained in:
2026-03-26 22:33:59 +00:00
parent 683cec9307
commit e568ddf82a
29972 changed files with 11269302 additions and 2 deletions

30
vendor/tower/src/limit/rate/rate.rs vendored Normal file
View File

@@ -0,0 +1,30 @@
use std::time::Duration;
/// A rate of requests per time period.
#[derive(Debug, Copy, Clone)]
pub struct Rate {
num: u64,
per: Duration,
}
impl Rate {
/// Create a new rate.
///
/// # Panics
///
/// This function panics if `num` or `per` is 0.
pub const fn new(num: u64, per: Duration) -> Self {
assert!(num > 0);
assert!(per.as_nanos() > 0);
Rate { num, per }
}
pub(crate) fn num(&self) -> u64 {
self.num
}
pub(crate) fn per(&self) -> Duration {
self.per
}
}