pub struct RateLimit {
pub limit_type: RateLimitType,
pub window: Duration,
pub limit: u32,
pub key: Option<String>,
}Expand description
速率限制配置 Rate limit configuration
Fields§
§limit_type: RateLimitType限制类型 Type of rate limit
window: Duration窗口大小(秒) Window size (seconds)
limit: u32限制数量 Limit count
key: Option<String>限制键(如果为空则使用任务类型) Limit key (if None, use task type)
Implementations§
Trait Implementations§
impl StructuralPartialEq for RateLimit
Auto Trait Implementations§
impl Freeze for RateLimit
impl RefUnwindSafe for RateLimit
impl Send for RateLimit
impl Sync for RateLimit
impl Unpin for RateLimit
impl UnsafeUnpin for RateLimit
impl UnwindSafe for RateLimit
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