pub trait BanStore: Send + Sync {
// Required methods
fn set_ban(
&self,
key: &str,
expiry: f64,
ttl_seconds: u64,
) -> Result<(), StoreError>;
fn get_ban(&self, key: &str) -> Result<Option<f64>, StoreError>;
fn delete_ban(&self, key: &str) -> Result<(), StoreError>;
}Expand description
The reference banned_ips storage operations (the
{prefix}banned_ips:{ip} namespace).
Required Methods§
Sourcefn set_ban(
&self,
key: &str,
expiry: f64,
ttl_seconds: u64,
) -> Result<(), StoreError>
fn set_ban( &self, key: &str, expiry: f64, ttl_seconds: u64, ) -> Result<(), StoreError>
SET key expiry EX ttl with the expiry as unix seconds (the
reference set_key("banned_ips", ip, str(expiry), ttl=duration)).
§Errors
StoreError when the backend call fails.
Sourcefn delete_ban(&self, key: &str) -> Result<(), StoreError>
fn delete_ban(&self, key: &str) -> Result<(), StoreError>
DEL key for a stale ban (the reference _check_redis_exact).
§Errors
StoreError when the backend call fails.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".