pub struct BarnacleConfig {
pub max_requests: u32,
pub window: Duration,
pub reset_on_success: ResetOnSuccess,
}
Expand description
Rate limiter configuration
Fields§
§max_requests: u32
§window: Duration
§reset_on_success: ResetOnSuccess
Implementations§
Source§impl BarnacleConfig
impl BarnacleConfig
Sourcepub fn is_success_status(&self, status_code: u16) -> bool
pub fn is_success_status(&self, status_code: u16) -> bool
Check if a status code should be considered successful for rate limit reset
Trait Implementations§
Source§impl Clone for BarnacleConfig
impl Clone for BarnacleConfig
Source§fn clone(&self) -> BarnacleConfig
fn clone(&self) -> BarnacleConfig
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 BarnacleConfig
impl Debug for BarnacleConfig
Source§impl Default for BarnacleConfig
impl Default for BarnacleConfig
Source§impl<'de> Deserialize<'de> for BarnacleConfig
impl<'de> Deserialize<'de> for BarnacleConfig
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 BarnacleConfig
impl RefUnwindSafe for BarnacleConfig
impl Send for BarnacleConfig
impl Sync for BarnacleConfig
impl Unpin for BarnacleConfig
impl UnwindSafe for BarnacleConfig
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