pub struct RateLimitHook {
pub name: String,
pub action: String,
pub to: Option<String>,
pub template: Option<String>,
pub url: Option<String>,
pub url_env: Option<String>,
pub method: Option<String>,
pub command: Vec<String>,
}Expand description
One named action that can run on a rate-limit hit.
action is one of:
wait— sleep untilresets_at(orfallback_wait_seconds).send— write a message into the mailbox;toandtemplaterequired.webhook— POST/GET tourl(orurl_env); the rate-limit row serializes as JSON in the body.run— execcommandwith placeholders substituted.
Placeholders in template and command arguments:
{agent}, {runtime}, {hit_at}, {resets_at}, {resets_at_local},
{raw_match}.
Fields§
§name: String§action: String§to: Option<String>§template: Option<String>§url: Option<String>§url_env: Option<String>§method: Option<String>§command: Vec<String>Trait Implementations§
Source§impl Clone for RateLimitHook
impl Clone for RateLimitHook
Source§fn clone(&self) -> RateLimitHook
fn clone(&self) -> RateLimitHook
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 RateLimitHook
impl Debug for RateLimitHook
Source§impl<'de> Deserialize<'de> for RateLimitHook
impl<'de> Deserialize<'de> for RateLimitHook
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 RateLimitHook
impl RefUnwindSafe for RateLimitHook
impl Send for RateLimitHook
impl Sync for RateLimitHook
impl Unpin for RateLimitHook
impl UnsafeUnpin for RateLimitHook
impl UnwindSafe for RateLimitHook
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