pub struct ThrottleOptions {
pub policy: ThrottlePolicy,
pub retry_after_header: bool,
pub store: Arc<dyn ThrottleStore>,
pub tracker: Arc<dyn ThrottleTracker>,
}Expand description
Request throttling primitives. Runtime throttling configuration.
Fields§
§policy: ThrottlePolicyGlobal policy applied to unannotated controller routes.
retry_after_header: boolWhether rejected responses include Retry-After.
store: Arc<dyn ThrottleStore>Atomic counter storage.
tracker: Arc<dyn ThrottleTracker>Client identity tracker.
Implementations§
Source§impl ThrottleOptions
impl ThrottleOptions
Sourcepub fn with_store(self, store: Arc<dyn ThrottleStore>) -> Self
pub fn with_store(self, store: Arc<dyn ThrottleStore>) -> Self
Replaces the atomic store.
Sourcepub fn with_tracker(self, tracker: Arc<dyn ThrottleTracker>) -> Self
pub fn with_tracker(self, tracker: Arc<dyn ThrottleTracker>) -> Self
Replaces the client tracker.
Sourcepub fn with_retry_after_header(self, enabled: bool) -> Self
pub fn with_retry_after_header(self, enabled: bool) -> Self
Controls whether rejected responses carry Retry-After.
Trait Implementations§
Source§impl Clone for ThrottleOptions
impl Clone for ThrottleOptions
Source§fn clone(&self) -> ThrottleOptions
fn clone(&self) -> ThrottleOptions
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for ThrottleOptions
impl !UnwindSafe for ThrottleOptions
impl Freeze for ThrottleOptions
impl Send for ThrottleOptions
impl Sync for ThrottleOptions
impl Unpin for ThrottleOptions
impl UnsafeUnpin for ThrottleOptions
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