pub struct LimitTrigger {Show 13 fields
pub name: String,
pub method: Option<MatchString>,
pub resource: i32,
pub arguments: Vec<MatchArgument>,
pub amounts: Vec<Amount>,
pub max_queue_delay: u32,
pub concurrency_amount: Option<ConcurrencyAmount>,
pub custom_response: Option<CustomResponse>,
pub regex_combine: bool,
pub failover: i32,
pub action: String,
pub disable: bool,
pub amount_mode: i32,
}Expand description
单个限流规则信息
Fields§
§name: String限流规则名
method: Option<MatchString>被调接口名
resource: i32§arguments: Vec<MatchArgument>被调的参数过滤条件,满足过滤条件才进入限流规则
amounts: Vec<Amount>限流阈值 可以有多个粒度的配置(比如同时针对秒级,分钟级,天级),匹配一个则进行限流 全局限流模式下,该值为服务配额总量;单机限流模式下,该值为单个节点能处理的配额量
max_queue_delay: u32最大排队时长,单位秒
concurrency_amount: Option<ConcurrencyAmount>amount for concurrency rate-limit
custom_response: Option<CustomResponse>fallback configuration
regex_combine: bool通配符是否合并计算,默认分开计数
failover: i32§action: String限流动作,和 resource 配合决定插件名称
disable: bool是否停用该限流规则,默认启用
amount_mode: i32Implementations§
Source§impl LimitTrigger
impl LimitTrigger
Sourcepub fn resource(&self) -> Resource
pub fn resource(&self) -> Resource
Returns the enum value of resource, or the default if the field is set to an invalid enum value.
Sourcepub fn set_resource(&mut self, value: Resource)
pub fn set_resource(&mut self, value: Resource)
Sets resource to the provided enum value.
Sourcepub fn failover(&self) -> FailoverType
pub fn failover(&self) -> FailoverType
Returns the enum value of failover, or the default if the field is set to an invalid enum value.
Sourcepub fn set_failover(&mut self, value: FailoverType)
pub fn set_failover(&mut self, value: FailoverType)
Sets failover to the provided enum value.
Sourcepub fn amount_mode(&self) -> AmountMode
pub fn amount_mode(&self) -> AmountMode
Returns the enum value of amount_mode, or the default if the field is set to an invalid enum value.
Sourcepub fn set_amount_mode(&mut self, value: AmountMode)
pub fn set_amount_mode(&mut self, value: AmountMode)
Sets amount_mode to the provided enum value.
Trait Implementations§
Source§impl Clone for LimitTrigger
impl Clone for LimitTrigger
Source§fn clone(&self) -> LimitTrigger
fn clone(&self) -> LimitTrigger
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 moreSource§impl Debug for LimitTrigger
impl Debug for LimitTrigger
Source§impl Default for LimitTrigger
impl Default for LimitTrigger
Source§impl Message for LimitTrigger
impl Message for LimitTrigger
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message to a newly allocated buffer.
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message with a length-delimiter to a buffer. Read more
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message with a length-delimiter to a newly allocated buffer.
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes an instance of the message from a buffer. Read more
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes a length-delimited instance of the message from the buffer.
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes an instance of the message from a buffer, and merges it into
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes a length-delimited instance of the message from buffer, and
merges it into
self.Source§impl PartialEq for LimitTrigger
impl PartialEq for LimitTrigger
impl StructuralPartialEq for LimitTrigger
Auto Trait Implementations§
impl Freeze for LimitTrigger
impl RefUnwindSafe for LimitTrigger
impl Send for LimitTrigger
impl Sync for LimitTrigger
impl Unpin for LimitTrigger
impl UnwindSafe for LimitTrigger
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request