#[non_exhaustive]pub struct RateLimitConfig { /* private fields */ }Expand description
Rolling-window REST rate-limit kinds, limits, and configuration.
Rolling-window REST rate-limit kinds, limits, and configuration.
Rolling-window REST rate-limit kinds, limits, and configuration.
Rate limits applied to authenticated ProjectX REST requests.
Default uses the provider’s documented limits: 50 history requests per
30 seconds and 200 other authenticated requests per 60 seconds.
Implementations§
Source§impl RateLimitConfig
impl RateLimitConfig
Sourcepub const fn new(history: RateLimit, general: RateLimit) -> Self
pub const fn new(history: RateLimit, general: RateLimit) -> Self
Creates configuration from dedicated history and general limits.
Sourcepub fn with_exit_reserve(self, reserve: usize) -> Result<Self, Error>
pub fn with_exit_reserve(self, reserve: usize) -> Result<Self, Error>
Reserves general-window capacity for cancellation and position closes.
Ordinary requests are admitted only below general.max_requests() - reserve; exits may use the full general limit. Both classes count
against the same rolling window and provider cooldown. The default is zero.
§Errors
Returns Error::Configuration when reserve is not smaller than
the general request limit, which must retain ordinary capacity.
Sourcepub const fn exit_reserve(self) -> usize
pub const fn exit_reserve(self) -> usize
Returns the general-window capacity reserved for cancellation and closes.