pub struct InMemoryRateLimiterConfig {
pub requests_per_second: f64,
pub max_bucket_size: f64,
pub check_every_n_seconds: f64,
}
Expand description
Serializable version of InMemoryRateLimiter for configuration
Fields§
§requests_per_second: f64
Number of requests that we can make per second
max_bucket_size: f64
Maximum number of tokens that can be in the bucket
check_every_n_seconds: f64
Check whether tokens are available every this many seconds
Trait Implementations§
Source§impl Clone for InMemoryRateLimiterConfig
impl Clone for InMemoryRateLimiterConfig
Source§fn clone(&self) -> InMemoryRateLimiterConfig
fn clone(&self) -> InMemoryRateLimiterConfig
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 InMemoryRateLimiterConfig
impl Debug for InMemoryRateLimiterConfig
Source§impl<'de> Deserialize<'de> for InMemoryRateLimiterConfig
impl<'de> Deserialize<'de> for InMemoryRateLimiterConfig
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
Source§impl Serializable for InMemoryRateLimiterConfig
impl Serializable for InMemoryRateLimiterConfig
Source§fn is_serializable() -> bool
fn is_serializable() -> bool
Check if this object is serializable Read more
Source§fn to_json_pretty(&self) -> Result<String>
fn to_json_pretty(&self) -> Result<String>
Serialize this object to a pretty-printed JSON string
Source§fn to_dict(&self) -> Result<HashMap<String, Value>>
fn to_dict(&self) -> Result<HashMap<String, Value>>
Serialize this object to a dictionary (HashMap)
Auto Trait Implementations§
impl Freeze for InMemoryRateLimiterConfig
impl RefUnwindSafe for InMemoryRateLimiterConfig
impl Send for InMemoryRateLimiterConfig
impl Sync for InMemoryRateLimiterConfig
impl Unpin for InMemoryRateLimiterConfig
impl UnwindSafe for InMemoryRateLimiterConfig
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