pub enum Constraint {
AtMost {
event_id: String,
limit: u32,
window_count: usize,
time_unit: TimeUnit,
},
AtLeast {
event_id: String,
count: u32,
window_count: usize,
time_unit: TimeUnit,
},
Cooldown {
event_id: String,
duration: Duration,
},
Within {
prerequisite_event: String,
duration: Duration,
},
During {
schedule: Schedule,
},
OutsideOf {
schedule: Schedule,
},
}Expand description
A rate limiting constraint.
Variants§
AtMost
Event must not exceed count within time window.
AtLeast
Event must have been recorded at least count times within time window.
Cooldown
Event must wait duration since last occurrence.
Within
Prerequisite event must have occurred within duration.
During
Current time must be within schedule.
OutsideOf
Current time must be outside schedule.
Trait Implementations§
Source§impl Clone for Constraint
impl Clone for Constraint
Source§fn clone(&self) -> Constraint
fn clone(&self) -> Constraint
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Constraint
impl !RefUnwindSafe for Constraint
impl Send for Constraint
impl Sync for Constraint
impl Unpin for Constraint
impl !UnwindSafe for Constraint
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more