pub struct InMemoryApiKeyStore { /* private fields */ }Expand description
In-memory store keyed by hex hash — for tests, the mock, and small deploys.
Production apps implement ApiKeyStore over their database instead.
Implementations§
Source§impl InMemoryApiKeyStore
impl InMemoryApiKeyStore
pub fn new() -> Self
Sourcepub fn insert(&self, record: ApiKeyRecord)
pub fn insert(&self, record: ApiKeyRecord)
Insert a record, indexed by its hash. Replaces any record with the same
hash (a hash collision would mean an identical key — practically never).
Trait Implementations§
Source§impl ApiKeyStore for InMemoryApiKeyStore
impl ApiKeyStore for InMemoryApiKeyStore
fn lookup<'a>(&'a self, hash: &'a str) -> ApiKeyFuture<'a, Option<ApiKeyRecord>>
Source§impl Default for InMemoryApiKeyStore
impl Default for InMemoryApiKeyStore
Source§fn default() -> InMemoryApiKeyStore
fn default() -> InMemoryApiKeyStore
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for InMemoryApiKeyStore
impl RefUnwindSafe for InMemoryApiKeyStore
impl Send for InMemoryApiKeyStore
impl Sync for InMemoryApiKeyStore
impl Unpin for InMemoryApiKeyStore
impl UnsafeUnpin for InMemoryApiKeyStore
impl UnwindSafe for InMemoryApiKeyStore
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