pub struct CacacheStorage { /* private fields */ }Available on crate feature
cacache-storage only.Expand description
The cacache storage. Store the token and answer in the disk.
Implementations§
Trait Implementations§
Source§impl CaptchaStorage for CacacheStorage
impl CaptchaStorage for CacacheStorage
Source§async fn store_answer(&self, answer: String) -> Result<String, Self::Error>
async fn store_answer(&self, answer: String) -> Result<String, Self::Error>
Store the captcha token and answer.
Source§async fn get_answer(&self, token: &str) -> Result<Option<String>, Self::Error>
async fn get_answer(&self, token: &str) -> Result<Option<String>, Self::Error>
Returns the answer of the captcha token. This method will return None if the token is not exist.
Source§async fn clear_expired(
&self,
expired_after: Duration,
) -> Result<(), Self::Error>
async fn clear_expired( &self, expired_after: Duration, ) -> Result<(), Self::Error>
Clear the expired captcha.
Source§impl Clone for CacacheStorage
impl Clone for CacacheStorage
Source§fn clone(&self) -> CacacheStorage
fn clone(&self) -> CacacheStorage
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 moreAuto Trait Implementations§
impl Freeze for CacacheStorage
impl RefUnwindSafe for CacacheStorage
impl Send for CacacheStorage
impl Sync for CacacheStorage
impl Unpin for CacacheStorage
impl UnwindSafe for CacacheStorage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more