pub struct VerificationStore<'a> { /* private fields */ }Expand description
Verification store that uses configured secondary storage when present.
Implementations§
Source§impl<'a> VerificationStore<'a>
impl<'a> VerificationStore<'a>
pub fn new(context: &'a AuthContext) -> Result<Self, RustAuthError>
pub async fn create_verification( &self, input: CreateVerificationInput, ) -> Result<Verification, RustAuthError>
pub async fn find_verification( &self, identifier: &str, ) -> Result<Option<Verification>, RustAuthError>
pub async fn find_verification_including_expired( &self, identifier: &str, ) -> Result<Option<Verification>, RustAuthError>
pub async fn update_verification( &self, identifier: &str, input: UpdateVerificationInput, ) -> Result<Option<Verification>, RustAuthError>
pub async fn delete_verification( &self, identifier: &str, ) -> Result<(), RustAuthError>
pub async fn take_verification( &self, identifier: &str, ) -> Result<Option<Verification>, RustAuthError>
pub async fn take_verification_including_expired( &self, identifier: &str, ) -> Result<Option<Verification>, RustAuthError>
Sourcepub async fn consume_verification_including_expired(
&self,
identifier: &str,
) -> Result<Option<Verification>, RustAuthError>
pub async fn consume_verification_including_expired( &self, identifier: &str, ) -> Result<Option<Verification>, RustAuthError>
Remove and return a verification without filtering on expiry.
Parallel callers only observe a successful consume once. Prefer this over
Self::take_verification_including_expired when the name should match
database-only call sites.
Sourcepub async fn compare_and_update_verification_value(
&self,
identifier: &str,
verification_id: &str,
expected_value: &str,
new_value: String,
) -> Result<Option<Verification>, RustAuthError>
pub async fn compare_and_update_verification_value( &self, identifier: &str, verification_id: &str, expected_value: &str, new_value: String, ) -> Result<Option<Verification>, RustAuthError>
Atomically updates a verification value only when its stored payload is unchanged.
pub async fn delete_expired_verifications(&self) -> Result<u64, RustAuthError>
Trait Implementations§
Source§impl<'a> Clone for VerificationStore<'a>
impl<'a> Clone for VerificationStore<'a>
Source§fn clone(&self) -> VerificationStore<'a>
fn clone(&self) -> VerificationStore<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a> !RefUnwindSafe for VerificationStore<'a>
impl<'a> !UnwindSafe for VerificationStore<'a>
impl<'a> Freeze for VerificationStore<'a>
impl<'a> Send for VerificationStore<'a>
impl<'a> Sync for VerificationStore<'a>
impl<'a> Unpin for VerificationStore<'a>
impl<'a> UnsafeUnpin for VerificationStore<'a>
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