pub struct StoreConfig {
pub store_type: StoreType,
pub capacity: usize,
pub cleanup_interval: u64,
pub cleanup_probability: u64,
pub min_interval: u64,
pub max_interval: u64,
pub max_operations: usize,
}Expand description
Rate limiter store configuration
Different store types have different performance characteristics:
- Periodic: Cleanups at fixed intervals, predictable memory usage
- Probabilistic: Random cleanups, lower overhead but less predictable
- Adaptive: Adjusts cleanup frequency based on load
Fields§
§store_type: StoreTypeType of store to use
capacity: usizeInitial capacity of the store
cleanup_interval: u64Cleanup interval for periodic store (seconds)
cleanup_probability: u64Cleanup probability for probabilistic store (1 in N)
min_interval: u64Minimum cleanup interval for adaptive store (seconds)
max_interval: u64Maximum cleanup interval for adaptive store (seconds)
max_operations: usizeMaximum operations before cleanup for adaptive store
Trait Implementations§
Source§impl Clone for StoreConfig
impl Clone for StoreConfig
Source§fn clone(&self) -> StoreConfig
fn clone(&self) -> StoreConfig
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 StoreConfig
impl Debug for StoreConfig
Source§impl<'de> Deserialize<'de> for StoreConfig
impl<'de> Deserialize<'de> for StoreConfig
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 StoreConfig
impl RefUnwindSafe for StoreConfig
impl Send for StoreConfig
impl Sync for StoreConfig
impl Unpin for StoreConfig
impl UnwindSafe for StoreConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request