Skip to main content

AuthMetricsCollector

Trait AuthMetricsCollector 

Source
pub trait AuthMetricsCollector: Send + Sync {
    // Provided methods
    fn metrics(&self) -> Option<&AuthMetrics> { ... }
    fn record_auth_attempt(
        &self,
        success: bool,
        error_code: Option<&AuthErrorCode>,
    ) { ... }
    fn time_jwks_fetch<F, R>(&self, f: F) -> R
       where F: FnOnce() -> R { ... }
    fn time_verification<F, R>(&self, f: F) -> R
       where F: FnOnce() -> R { ... }
}
Expand description

Trait for collecting auth metrics

Provided Methods§

Source

fn metrics(&self) -> Option<&AuthMetrics>

Get auth metrics

Source

fn record_auth_attempt(&self, success: bool, error_code: Option<&AuthErrorCode>)

Record an authentication attempt with metrics

Source

fn time_jwks_fetch<F, R>(&self, f: F) -> R
where F: FnOnce() -> R,

Time a JWKS fetch operation

Source

fn time_verification<F, R>(&self, f: F) -> R
where F: FnOnce() -> R,

Time a token verification operation

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§