pub struct RateLimitPattern {
pub match: String,
pub resets_at_capture: Option<String>,
pub resets_in_capture: Option<String>,
}Expand description
One rate-limit detector. match is a regex tested against each line
of runtime output. If matched, the wrapper records a hit. The optional
captures attempt to extract when the limit lifts.
Fields§
§match: StringRegex tested against each output line.
resets_at_capture: Option<String>Optional regex with one capture group of an absolute reset clock, e.g. “resets at (4pm)” or “resets at (16:00)” or an RFC3339 timestamp.
resets_in_capture: Option<String>Optional regex with one capture group of a relative duration, e.g. “in (5h 15m)” or “in (1h)” or “(\d+) seconds”.
Trait Implementations§
Source§impl Clone for RateLimitPattern
impl Clone for RateLimitPattern
Source§fn clone(&self) -> RateLimitPattern
fn clone(&self) -> RateLimitPattern
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 RateLimitPattern
impl Debug for RateLimitPattern
Source§impl<'de> Deserialize<'de> for RateLimitPattern
impl<'de> Deserialize<'de> for RateLimitPattern
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 RateLimitPattern
impl RefUnwindSafe for RateLimitPattern
impl Send for RateLimitPattern
impl Sync for RateLimitPattern
impl Unpin for RateLimitPattern
impl UnsafeUnpin for RateLimitPattern
impl UnwindSafe for RateLimitPattern
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