Skip to main content

Rule

Trait Rule 

Source
pub trait Rule: Send + Sync {
    // Required method
    fn evaluate(
        &self,
        request: &SessionRequest,
        ctx: &PolicyContext,
    ) -> Result<(), PolicyDenial>;
}
Expand description

A single policy rule. Implementations decide whether to allow or deny a session request based on the request and context.

Required Methods§

Source

fn evaluate( &self, request: &SessionRequest, ctx: &PolicyContext, ) -> Result<(), PolicyDenial>

Evaluate the rule. Returns Ok(()) if allowed, Err(PolicyDenial) if denied.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§