codlet_core/auth/
norate.rs1use crate::store::error::StoreError;
9use crate::store::ratelimit::{RateLimitKey, RateLimitOutcome, RateLimitPolicy, RateLimitStore};
10
11#[derive(Debug, Default, Clone, Copy)]
14pub struct NoRateLimit;
15
16impl RateLimitStore for NoRateLimit {
17 async fn check(
18 &self,
19 _key: &RateLimitKey,
20 _policy: &RateLimitPolicy,
21 ) -> Result<RateLimitOutcome, StoreError> {
22 Ok(RateLimitOutcome::Allow)
23 }
24
25 async fn record_failure(
26 &self,
27 _key: &RateLimitKey,
28 _policy: &RateLimitPolicy,
29 ) -> Result<(), StoreError> {
30 Ok(())
31 }
32
33 async fn clear_failures(&self, _key: &RateLimitKey) -> Result<(), StoreError> {
34 Ok(())
35 }
36}