pub struct RateLimitRule {
pub name: String,
pub key_prefix: String,
pub limiter_type: String,
pub capacity: u64,
pub window_ms: u64,
pub enabled: bool,
}Expand description
限流规则
描述一条限流规则,包括匹配条件和限流参数。
Fields§
§name: String规则名称
key_prefix: String匹配的 key 前缀
limiter_type: String限流器类型
capacity: u64容量
window_ms: u64窗口大小(毫秒)
enabled: bool是否启用
Implementations§
Trait Implementations§
Source§impl Clone for RateLimitRule
impl Clone for RateLimitRule
Source§fn clone(&self) -> RateLimitRule
fn clone(&self) -> RateLimitRule
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RateLimitRule
impl Debug for RateLimitRule
Source§impl<'de> Deserialize<'de> for RateLimitRule
impl<'de> Deserialize<'de> for RateLimitRule
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RateLimitRule
impl RefUnwindSafe for RateLimitRule
impl Send for RateLimitRule
impl Sync for RateLimitRule
impl Unpin for RateLimitRule
impl UnsafeUnpin for RateLimitRule
impl UnwindSafe for RateLimitRule
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