Skip to main content

SecurityRule

Trait SecurityRule 

Source
pub trait SecurityRule:
    Send
    + Sync
    + 'static {
    // Required method
    fn inspect(&self, ctx: &Context) -> Result<(), SecurityViolation>;
}
Expand description

Extensible request inspection rule evaluated before routing.

Required Methods§

Source

fn inspect(&self, ctx: &Context) -> Result<(), SecurityViolation>

Inspects ctx and returns Err(SecurityViolation) to block the request immediately.

§Arguments
  • &Context - Incoming request context.
§Returns
  • Result<(), SecurityViolation> - Ok(()) to permit, or violation details to reject.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§