Skip to content

Commit

Permalink
throttle: keep unused fields private
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Sep 20, 2024
1 parent 0861a77 commit 5fa5a6d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/throttle/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,15 @@ impl TryFrom<&str> for ThrottleSpec {
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct ThrottleResult {
/// true if the action was limited
pub throttled: bool,
pub(crate) throttled: bool,
/// The total limit of the key (max_burst + 1). This is equivalent to the common
/// X-RateLimit-Limit HTTP header.
pub limit: u64,
pub(crate) limit: u64,
/// The remaining limit of the key. Equivalent to X-RateLimit-Remaining.
pub remaining: u64,
pub(crate) remaining: u64,
/// The number of seconds until the limit will reset to its maximum capacity.
/// Equivalent to X-RateLimit-Reset.
pub reset_after: Duration,
pub(crate) reset_after: Duration,
/// The number of seconds until the user should retry, but None if the action was
/// allowed. Equivalent to Retry-After.
pub retry_after: Option<Duration>,
Expand Down

0 comments on commit 5fa5a6d

Please sign in to comment.