pub trait AuthValidator: Send + Sync {
// Required method
fn validate<'a>(
&'a self,
token: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Claims, AuthError>> + Send + 'a>>;
}Expand description
Object-safe trait for pluggable token validation.
Implementations receive the raw token string (already stripped of any
scheme prefix) and return parsed Claims on success.
§Object-safety
The associated future is erased behind Pin<Box<dyn Future + Send + '_>>
to keep the trait object-safe and usable with dyn AuthValidator.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".