pub struct LimitOverride {
pub qps: Option<u32>,
pub burst: Option<u32>,
pub max_concurrent: Option<u32>,
pub exceeded_action: Option<ExceededAction>,
pub duration: Option<Duration>,
pub created_at: Instant,
}Expand description
Per-key limit override
Fields§
§qps: Option<u32>Queries per second
burst: Option<u32>Burst capacity
max_concurrent: Option<u32>Maximum concurrent queries
exceeded_action: Option<ExceededAction>Custom action when exceeded
duration: Option<Duration>Override duration (None = permanent)
created_at: InstantWhen override was created
Implementations§
Source§impl LimitOverride
impl LimitOverride
Sourcepub fn with_burst(self, burst: u32) -> Self
pub fn with_burst(self, burst: u32) -> Self
Set burst capacity
Sourcepub fn with_max_concurrent(self, max: u32) -> Self
pub fn with_max_concurrent(self, max: u32) -> Self
Set max concurrent
Sourcepub fn with_action(self, action: ExceededAction) -> Self
pub fn with_action(self, action: ExceededAction) -> Self
Set exceeded action
Sourcepub fn with_duration(self, duration: Duration) -> Self
pub fn with_duration(self, duration: Duration) -> Self
Set duration
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if override has expired
Trait Implementations§
Source§impl Clone for LimitOverride
impl Clone for LimitOverride
Source§fn clone(&self) -> LimitOverride
fn clone(&self) -> LimitOverride
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 LimitOverride
impl Debug for LimitOverride
Auto Trait Implementations§
impl Freeze for LimitOverride
impl RefUnwindSafe for LimitOverride
impl Send for LimitOverride
impl Sync for LimitOverride
impl Unpin for LimitOverride
impl UnsafeUnpin for LimitOverride
impl UnwindSafe for LimitOverride
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> 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>
Converts
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>
Converts
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