pub struct RouteRateLimit {
pub rate: u64,
pub burst: u64,
pub key: RateLimitKeyKind,
}Expand description
Native per-route rate-limit spec (ADR 000033), declared as [route.rate_limit]. A coarse
token bucket the fast path consults before forwarding — the Tier-0 baseline a filterless route
otherwise lacks. rate/burst map onto the same token-bucket math as host-ratelimit
(capacity = burst, refill rate tokens every second), but the surface is deliberately the
friendlier two-knob (rate + burst) form, since this is a blunt floor, not a policy limiter.
Fields§
§rate: u64Sustained requests per second (tokens added each second). Must be non-zero.
burst: u64Burst capacity: the most tokens the bucket holds (and starts full with). Must be non-zero.
key: RateLimitKeyKindWhat the bucket counts against (default route). route shares one bucket across every
client of the route (a total floor); client-ip gives each client its own bucket (fairness
between clients), keyed on the connection peer (v4 /32, v6 /64).
Trait Implementations§
Source§impl Clone for RouteRateLimit
impl Clone for RouteRateLimit
Source§fn clone(&self) -> RouteRateLimit
fn clone(&self) -> RouteRateLimit
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for RouteRateLimit
Source§impl Debug for RouteRateLimit
impl Debug for RouteRateLimit
Source§impl<'de> Deserialize<'de> for RouteRateLimit
impl<'de> Deserialize<'de> for RouteRateLimit
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>,
impl Eq for RouteRateLimit
Source§impl JsonSchema for RouteRateLimit
impl JsonSchema for RouteRateLimit
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 inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for RouteRateLimit
impl PartialEq for RouteRateLimit
Source§impl Serialize for RouteRateLimit
impl Serialize for RouteRateLimit
impl StructuralPartialEq for RouteRateLimit
Auto Trait Implementations§
impl Freeze for RouteRateLimit
impl RefUnwindSafe for RouteRateLimit
impl Send for RouteRateLimit
impl Sync for RouteRateLimit
impl Unpin for RouteRateLimit
impl UnsafeUnpin for RouteRateLimit
impl UnwindSafe for RouteRateLimit
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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