pub trait RateLimitStorage:
Send
+ Sync
+ 'static {
// Required methods
fn get(&self, key: &str) -> Result<Option<RateLimitRecord>, RustAuthError>;
fn set(
&self,
key: &str,
value: RateLimitRecord,
ttl_seconds: u64,
update: bool,
) -> Result<(), RustAuthError>;
}Expand description
Synchronous storage contract for router-level rate limiting.
This legacy contract is preserved for compatibility. It is not atomic across
multiple processes unless the implementation makes get/set externally
serializable.
Required Methods§
fn get(&self, key: &str) -> Result<Option<RateLimitRecord>, RustAuthError>
fn set( &self, key: &str, value: RateLimitRecord, ttl_seconds: u64, update: bool, ) -> Result<(), RustAuthError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".