pub struct RateLimitError {
pub message: String,
pub limit: usize,
pub window: Duration,
pub key: String,
pub reset_time: Option<Instant>,
}Expand description
Custom error type for rate limit exceeded
Fields§
§message: StringCustom error message
limit: usizeRate limit (requests per window)
window: DurationTime window duration
key: StringKey that exceeded the limit
reset_time: Option<Instant>When the limit resets
Trait Implementations§
Source§impl Debug for RateLimitError
impl Debug for RateLimitError
Source§impl Display for RateLimitError
impl Display for RateLimitError
Auto Trait Implementations§
impl Freeze for RateLimitError
impl RefUnwindSafe for RateLimitError
impl Send for RateLimitError
impl Sync for RateLimitError
impl Unpin for RateLimitError
impl UnwindSafe for RateLimitError
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