Skip to main content

parse_rate_limit_wait_secs

Function parse_rate_limit_wait_secs 

Source
pub fn parse_rate_limit_wait_secs(stderr: &str) -> Option<u64>
Expand description

Parse the RFC 2822 retry deadline crates.io embeds in a refusal.

The message reads Please try again after Tue, 29 Sep 2026 04:55:57 GMT, where the day-of-week prefix and the GMT suffix are noise. A timestamp that does not match that shape yields None so the caller falls back to the conservative floor instead of guessing a shorter wait.

§Arguments

  • &str - cargo publish stderr output

§Returns

  • Option<u64> - Seconds to wait, or None when no deadline is present