pub struct Random { /* private fields */ }Implementations§
Source§impl Random
impl Random
pub fn new(delay_min: Milliseconds, delay_max: Milliseconds) -> Self
Trait Implementations§
Source§impl ThrottleStrategy for Random
impl ThrottleStrategy for Random
Source§fn throttle(&self, _flow_control_headers: Option<&FlowControlHeaders>)
fn throttle(&self, _flow_control_headers: Option<&FlowControlHeaders>)
Throttle the request based on optional flow control headers.
Implementers 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.
Source§fn strategy(&self) -> ThrottleStrategyType
fn strategy(&self) -> ThrottleStrategyType
Return strategy type
Source§fn throttle_for(&self, delay: Milliseconds)
fn throttle_for(&self, delay: Milliseconds)
Throttle for specific amount of time.
Auto Trait Implementations§
impl Freeze for Random
impl RefUnwindSafe for Random
impl Send for Random
impl Sync for Random
impl Unpin for Random
impl UnwindSafe for Random
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