pub struct InMemoryMagicCodeBackend { /* private fields */ }Expand description
In-memory backend for magic codes. The default — also used as the
authoritative cache by MagicCodeStore.
Implementations§
Trait Implementations§
Source§impl Default for InMemoryMagicCodeBackend
impl Default for InMemoryMagicCodeBackend
Source§impl MagicCodeBackend for InMemoryMagicCodeBackend
impl MagicCodeBackend for InMemoryMagicCodeBackend
Source§fn get(&self, email: &str) -> Option<MagicCode>
fn get(&self, email: &str) -> Option<MagicCode>
Look up the current code for
email. Returns None if absent.Source§fn remove(&self, email: &str)
fn remove(&self, email: &str)
Remove the code for
email (called on successful verify or
expiry). Idempotent — missing key is not an error.Source§fn bump_attempts(&self, email: &str)
fn bump_attempts(&self, email: &str)
Persist an attempts++ on the existing record without touching
other fields. Used by the verify-failed path to enforce
MAX_ATTEMPTS across restarts.Auto Trait Implementations§
impl !Freeze for InMemoryMagicCodeBackend
impl RefUnwindSafe for InMemoryMagicCodeBackend
impl Send for InMemoryMagicCodeBackend
impl Sync for InMemoryMagicCodeBackend
impl Unpin for InMemoryMagicCodeBackend
impl UnsafeUnpin for InMemoryMagicCodeBackend
impl UnwindSafe for InMemoryMagicCodeBackend
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