pub struct FluxLimiterConfig { /* private fields */ }Expand description
Configuration for rate limiter behavior.
§Examples
use flux_limiter::FluxLimiterConfig;
let config = FluxLimiterConfig::new(10.0, 5.0)
.rate(20.0)
.burst(10.0);Implementations§
Source§impl FluxLimiterConfig
impl FluxLimiterConfig
Sourcepub fn new(rate_per_second: f64, burst_capacity: f64) -> Self
pub fn new(rate_per_second: f64, burst_capacity: f64) -> Self
Create a new configuration with rate and burst settings.
§Arguments
rate_per_second- Maximum sustained rate (must be > 0)burst_capacity- Additional burst allowance (must be ≥ 0)
Sourcepub fn validate(&self) -> Result<(), FluxLimiterError>
pub fn validate(&self) -> Result<(), FluxLimiterError>
Validate the configuration
Trait Implementations§
Source§impl Clone for FluxLimiterConfig
impl Clone for FluxLimiterConfig
Source§fn clone(&self) -> FluxLimiterConfig
fn clone(&self) -> FluxLimiterConfig
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 moreAuto Trait Implementations§
impl Freeze for FluxLimiterConfig
impl RefUnwindSafe for FluxLimiterConfig
impl Send for FluxLimiterConfig
impl Sync for FluxLimiterConfig
impl Unpin for FluxLimiterConfig
impl UnwindSafe for FluxLimiterConfig
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