pub struct NoopBackend;Available on crate feature
test-util only.Expand description
No-op backend: allows every request with the quota’s full budget.
Intended for tests, as a feature-flag “kill switch” that never throttles, or as a placeholder while wiring a real backend. Not for production limiting — it enforces nothing.
§Examples
use throttle_kit::{NoopBackend, Quota, RateLimiter};
let limiter = RateLimiter::new(Quota::per_second(10), NoopBackend);
// Never throttles: every check is allowed with a full budget.
assert!(limiter.check("anything").await.allowed);
assert!(limiter.check("anything").await.allowed);Trait Implementations§
Source§impl Clone for NoopBackend
impl Clone for NoopBackend
Source§fn clone(&self) -> NoopBackend
fn clone(&self) -> NoopBackend
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for NoopBackend
Source§impl Debug for NoopBackend
impl Debug for NoopBackend
Source§impl Default for NoopBackend
impl Default for NoopBackend
Source§fn default() -> NoopBackend
fn default() -> NoopBackend
Returns the “default value” for a type. Read more
Source§impl RateLimitBackend for NoopBackend
impl RateLimitBackend for NoopBackend
Auto Trait Implementations§
impl Freeze for NoopBackend
impl RefUnwindSafe for NoopBackend
impl Send for NoopBackend
impl Sync for NoopBackend
impl Unpin for NoopBackend
impl UnsafeUnpin for NoopBackend
impl UnwindSafe for NoopBackend
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