pub trait ThrottleStrategy {
// Required methods
fn throttle(&self, flow_control_headers: Option<&FlowControlHeaders>);
fn strategy(&self) -> ThrottleStrategyType;
// Provided method
fn throttle_for(&self, delay: Milliseconds) { ... }
}Expand description
Throttle strategy
Required Methods§
Sourcefn throttle(&self, flow_control_headers: Option<&FlowControlHeaders>)
fn throttle(&self, flow_control_headers: Option<&FlowControlHeaders>)
Throttle the request based on optional flow control headers. Implementors might use the headers to adjust the throttling or ignore them altogether. Ex. strategies could be a fixed delay, random, or based on rate limiting headers.
Sourcefn strategy(&self) -> ThrottleStrategyType
fn strategy(&self) -> ThrottleStrategyType
Return strategy type
Provided Methods§
Sourcefn throttle_for(&self, delay: Milliseconds)
fn throttle_for(&self, delay: Milliseconds)
Throttle for specific amount of time.