pub struct MiddlewareRateLimitSourceCriterion {
pub ip_strategy: Option<MiddlewareRateLimitSourceCriterionIpStrategy>,
pub request_header_name: Option<String>,
pub request_host: Option<bool>,
}
Expand description
SourceCriterion defines what criterion is used to group requests as originating from a common source. If several strategies are defined at the same time, an error will be raised. If none are set, the default is to use the request’s remote address field (as an ipStrategy).
Fields§
§ip_strategy: Option<MiddlewareRateLimitSourceCriterionIpStrategy>
IPStrategy holds the IP strategy configuration used by Traefik to determine the client IP. More info: https://doc.traefik.io/traefik/v3.3/middlewares/http/ipallowlist/#ipstrategy
request_header_name: Option<String>
RequestHeaderName defines the name of the header used to group incoming requests.
request_host: Option<bool>
RequestHost defines whether to consider the request Host as the source.
Implementations§
Source§impl MiddlewareRateLimitSourceCriterion
impl MiddlewareRateLimitSourceCriterion
Sourcepub fn builder() -> MiddlewareRateLimitSourceCriterionBuilder<((), (), ())>
pub fn builder() -> MiddlewareRateLimitSourceCriterionBuilder<((), (), ())>
Create a builder for building MiddlewareRateLimitSourceCriterion
.
On the builder, call .ip_strategy(...)
(optional), .request_header_name(...)
(optional), .request_host(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of MiddlewareRateLimitSourceCriterion
.
Trait Implementations§
Source§impl Clone for MiddlewareRateLimitSourceCriterion
impl Clone for MiddlewareRateLimitSourceCriterion
Source§fn clone(&self) -> MiddlewareRateLimitSourceCriterion
fn clone(&self) -> MiddlewareRateLimitSourceCriterion
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Default for MiddlewareRateLimitSourceCriterion
impl Default for MiddlewareRateLimitSourceCriterion
Source§fn default() -> MiddlewareRateLimitSourceCriterion
fn default() -> MiddlewareRateLimitSourceCriterion
Source§impl<'de> Deserialize<'de> for MiddlewareRateLimitSourceCriterion
impl<'de> Deserialize<'de> for MiddlewareRateLimitSourceCriterion
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>,
Source§impl JsonSchema for MiddlewareRateLimitSourceCriterion
impl JsonSchema for MiddlewareRateLimitSourceCriterion
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moreSource§impl PartialEq for MiddlewareRateLimitSourceCriterion
impl PartialEq for MiddlewareRateLimitSourceCriterion
Source§fn eq(&self, other: &MiddlewareRateLimitSourceCriterion) -> bool
fn eq(&self, other: &MiddlewareRateLimitSourceCriterion) -> bool
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for MiddlewareRateLimitSourceCriterion
Auto Trait Implementations§
impl Freeze for MiddlewareRateLimitSourceCriterion
impl RefUnwindSafe for MiddlewareRateLimitSourceCriterion
impl Send for MiddlewareRateLimitSourceCriterion
impl Sync for MiddlewareRateLimitSourceCriterion
impl Unpin for MiddlewareRateLimitSourceCriterion
impl UnwindSafe for MiddlewareRateLimitSourceCriterion
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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more