pub struct ConcurrencyConfig { /* private fields */ }Expand description
Top-level configuration for ConcurrencyLimiter and ConcurrencyPlugin.
Implementations§
Source§impl ConcurrencyConfig
Fluent configuration builders for ConcurrencyConfig.
impl ConcurrencyConfig
Fluent configuration builders for ConcurrencyConfig.
Sourcepub fn new(max_in_flight: usize) -> Self
pub fn new(max_in_flight: usize) -> Self
Creates a ConcurrencyConfig capped at max_in_flight concurrent requests.
§Arguments
usize- Global in-flight limit (>= 1).
§Returns
Self- Constructed configuration.
Sourcepub fn with_max_in_flight(self, max_in_flight: usize) -> Self
pub fn with_max_in_flight(self, max_in_flight: usize) -> Self
Sourcepub fn with_wait_timeout_ms(self, wait_timeout_ms: u64) -> Self
pub fn with_wait_timeout_ms(self, wait_timeout_ms: u64) -> Self
Sourcepub fn with_adaptive(self, adaptive: AdaptiveShedConfig) -> Self
pub fn with_adaptive(self, adaptive: AdaptiveShedConfig) -> Self
Sourcepub fn with_prefix_limit(self, rule: PrefixConcurrencyLimit) -> Self
pub fn with_prefix_limit(self, rule: PrefixConcurrencyLimit) -> Self
Sourcepub fn with_exempt_paths<I, S>(self, paths: I) -> Self
pub fn with_exempt_paths<I, S>(self, paths: I) -> Self
Sourcepub fn with_retry_after_secs(self, secs: u64) -> Self
pub fn with_retry_after_secs(self, secs: u64) -> Self
Sourcepub fn with_reject_body<C, B>(self, content_type: C, body: B) -> Self
pub fn with_reject_body<C, B>(self, content_type: C, body: B) -> Self
Source§impl ConcurrencyConfig
impl ConcurrencyConfig
pub fn get_max_in_flight(&self) -> usize
pub fn get_mut_max_in_flight(&mut self) -> &mut usize
pub fn set_max_in_flight(&mut self, val: usize) -> &mut Self
pub fn get_wait_timeout_ms(&self) -> u64
pub fn get_mut_wait_timeout_ms(&mut self) -> &mut u64
pub fn set_wait_timeout_ms(&mut self, val: u64) -> &mut Self
pub fn get_adaptive(&self) -> Option<AdaptiveShedConfig>
pub fn try_get_adaptive(&self) -> Option<AdaptiveShedConfig>
pub fn get_mut_adaptive(&mut self) -> &mut Option<AdaptiveShedConfig>
pub fn set_adaptive(&mut self, val: Option<AdaptiveShedConfig>) -> &mut Self
pub fn get_prefix_limits(&self) -> &Vec<PrefixConcurrencyLimit>
pub fn get_mut_prefix_limits(&mut self) -> &mut Vec<PrefixConcurrencyLimit>
pub fn set_prefix_limits( &mut self, val: Vec<PrefixConcurrencyLimit>, ) -> &mut Self
pub fn get_exempt_paths(&self) -> &Vec<String>
pub fn get_mut_exempt_paths(&mut self) -> &mut Vec<String>
pub fn set_exempt_paths(&mut self, val: Vec<String>) -> &mut Self
pub fn get_retry_after_secs(&self) -> u64
pub fn get_mut_retry_after_secs(&mut self) -> &mut u64
pub fn set_retry_after_secs(&mut self, val: u64) -> &mut Self
pub fn get_reject_content_type(&self) -> &String
pub fn get_mut_reject_content_type(&mut self) -> &mut String
pub fn set_reject_content_type(&mut self, val: String) -> &mut Self
pub fn get_reject_body(&self) -> &Vec<u8> ⓘ
pub fn get_mut_reject_body(&mut self) -> &mut Vec<u8> ⓘ
pub fn set_reject_body(&mut self, val: Vec<u8>) -> &mut Self
Trait Implementations§
Source§impl Clone for ConcurrencyConfig
impl Clone for ConcurrencyConfig
Source§impl Debug for ConcurrencyConfig
impl Debug for ConcurrencyConfig
Source§impl Default for ConcurrencyConfig
Default construction for ConcurrencyConfig.
impl Default for ConcurrencyConfig
Default construction for ConcurrencyConfig.
Source§fn default() -> Self
fn default() -> Self
Constructs a default ConcurrencyConfig (1 024 max in-flight, immediate shedding, 503 + Retry-After: 1).
§Returns
Self- Default configuration.
impl Eq for ConcurrencyConfig
Source§impl PartialEq for ConcurrencyConfig
impl PartialEq for ConcurrencyConfig
impl StructuralPartialEq for ConcurrencyConfig
Auto Trait Implementations§
impl Forget for ConcurrencyConfig
impl Freeze for ConcurrencyConfigwhere
*const u8 is !null: Freeze,
PhantomData<PrefixConcurrencyLimit>: Freeze,
PhantomData<String>: Freeze,
PhantomData<u8>: Freeze,
impl Move for ConcurrencyConfig
impl RefUnwindSafe for ConcurrencyConfig
impl Send for ConcurrencyConfigwhere
RawVecInner: Send,
impl Sync for ConcurrencyConfigwhere
RawVecInner: Sync,
impl Unpin for ConcurrencyConfig
impl UnsafeUnpin for ConcurrencyConfigwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<PrefixConcurrencyLimit>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
impl UnwindSafe for ConcurrencyConfigwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
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<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
Compare self to
key and return true if they are equal.