pub struct RateLimitState {
pub is_limited: bool,
pub remaining: Option<u32>,
pub reset_at: Option<i64>,
pub retry_after_ms: Option<u64>,
}Expand description
Rate limit state from the connection service.
Fields§
§is_limited: boolWhether the connection is currently rate limited
remaining: Option<u32>Remaining requests in the current window (if known)
reset_at: Option<i64>Unix timestamp when the rate limit resets
retry_after_ms: Option<u64>Milliseconds to wait before retrying
Implementations§
Source§impl RateLimitState
impl RateLimitState
Sourcepub fn wait_duration(&self) -> Duration
pub fn wait_duration(&self) -> Duration
Get the duration to wait before retrying.
Trait Implementations§
Source§impl Clone for RateLimitState
impl Clone for RateLimitState
Source§fn clone(&self) -> RateLimitState
fn clone(&self) -> RateLimitState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RateLimitState
impl Debug for RateLimitState
Source§impl<'de> Deserialize<'de> for RateLimitState
impl<'de> Deserialize<'de> for RateLimitState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RateLimitState
impl RefUnwindSafe for RateLimitState
impl Send for RateLimitState
impl Sync for RateLimitState
impl Unpin for RateLimitState
impl UnwindSafe for RateLimitState
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