pub struct ApiKeyValidator { /* private fields */ }Expand description
Simple in-memory API key validator
For production use, consider:
- Database-backed validation
- Caching with TTL
- Rate limiting per key
Implementations§
Trait Implementations§
Source§impl Clone for ApiKeyValidator
impl Clone for ApiKeyValidator
Source§fn clone(&self) -> ApiKeyValidator
fn clone(&self) -> ApiKeyValidator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ApiKeyValidator
impl Debug for ApiKeyValidator
Source§impl Validate for ApiKeyValidator
impl Validate for ApiKeyValidator
Source§async fn validate(&self, key: &str) -> AuthResult
async fn validate(&self, key: &str) -> AuthResult
Validate a credential and return the authentication result.
Auto Trait Implementations§
impl Freeze for ApiKeyValidator
impl RefUnwindSafe for ApiKeyValidator
impl Send for ApiKeyValidator
impl Sync for ApiKeyValidator
impl Unpin for ApiKeyValidator
impl UnwindSafe for ApiKeyValidator
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