Skip to main content

with_retry_deadline

Function with_retry_deadline 

Source
pub async fn with_retry_deadline<F: Future>(
    deadline: Instant,
    future: F,
) -> F::Output
Expand description

Run future so that every rate-limit wait of [retry_async!] inside it ends by deadline. A wait that would pass it returns the rejection at once, so a caller that times out at deadline still sees the delay. A nested scope keeps the earlier deadline.