pub struct RateLimitModule { /* private fields */ }Implementations§
Source§impl RateLimitModule
impl RateLimitModule
pub fn new() -> Self
Sourcepub fn with_clock(clock: Arc<dyn Clock>) -> Self
pub fn with_clock(clock: Arc<dyn Clock>) -> Self
Construct with a custom clock (used by tests): an in-memory store driven by that clock, default tracked-key cap.
Sourcepub fn with_state(state: RateLimitState) -> Self
pub fn with_state(state: RateLimitState) -> Self
Construct with a shared store, reinjected across reloads so the throttle state persists when only config parameters change.
Trait Implementations§
Source§impl Default for RateLimitModule
impl Default for RateLimitModule
Source§impl WafModule for RateLimitModule
impl WafModule for RateLimitModule
fn id(&self) -> &str
fn phase(&self) -> Phase
Source§fn init(&mut self, cfg: &Config)
fn init(&mut self, cfg: &Config)
Called once at startup; compile/init rules here, never in
inspect.Source§fn inspect(&self, ctx: &RequestContext) -> Decision
fn inspect(&self, ctx: &RequestContext) -> Decision
Read-only access to context; pipeline owns mutation of
score.Source§fn structural(&self) -> bool
fn structural(&self) -> bool
true for a STRUCTURAL inspection module (e.g. GraphQL) whose decision does
NOT come from a content-rule match. The content fast-path (Pillar 3) may prove
“no content rule can match” and skip CONTENT inspection — but it cannot prove
a structural module is inert, so structural modules run even on the skip path.
Default false (a content module, gated by the fast-path).Auto Trait Implementations§
impl !RefUnwindSafe for RateLimitModule
impl !UnwindSafe for RateLimitModule
impl Freeze for RateLimitModule
impl Send for RateLimitModule
impl Sync for RateLimitModule
impl Unpin for RateLimitModule
impl UnsafeUnpin for RateLimitModule
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