pub struct AutoThrottleMiddlewareBuilder { /* private fields */ }Expand description
Builder for AutoThrottleMiddleware.
Implementations§
Source§impl AutoThrottleMiddlewareBuilder
impl AutoThrottleMiddlewareBuilder
Sourcepub fn target_concurrency(self, target_concurrency: f64) -> Self
pub fn target_concurrency(self, target_concurrency: f64) -> Self
Sets target concurrency used in latency / target_concurrency.
Sourcepub fn smoothing_factor(self, smoothing_factor: f64) -> Self
pub fn smoothing_factor(self, smoothing_factor: f64) -> Self
Sets smoothing factor (0.0..=1.0) for delay updates.
Sourcepub fn error_penalty(self, error_penalty: f64) -> Self
pub fn error_penalty(self, error_penalty: f64) -> Self
Sets multiplier for 5xx responses.
Sourcepub fn forbidden_penalty(self, forbidden_penalty: f64) -> Self
pub fn forbidden_penalty(self, forbidden_penalty: f64) -> Self
Sets multiplier for 403 responses.
Sourcepub fn too_many_penalty(self, too_many_penalty: f64) -> Self
pub fn too_many_penalty(self, too_many_penalty: f64) -> Self
Sets multiplier for 429 responses.
Sourcepub fn cache_capacity(self, cache_capacity: u64) -> Self
pub fn cache_capacity(self, cache_capacity: u64) -> Self
Sets middleware state cache capacity.
Sourcepub fn build(self) -> AutoThrottleMiddleware
pub fn build(self) -> AutoThrottleMiddleware
Builds AutoThrottleMiddleware.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AutoThrottleMiddlewareBuilder
impl RefUnwindSafe for AutoThrottleMiddlewareBuilder
impl Send for AutoThrottleMiddlewareBuilder
impl Sync for AutoThrottleMiddlewareBuilder
impl Unpin for AutoThrottleMiddlewareBuilder
impl UnwindSafe for AutoThrottleMiddlewareBuilder
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