pub struct MemoryCsrfTokenStore { /* private fields */ }Expand description
In-memory CSRF token store.
Implementations§
Source§impl MemoryCsrfTokenStore
impl MemoryCsrfTokenStore
pub fn new() -> MemoryCsrfTokenStore
Trait Implementations§
Source§impl Clone for MemoryCsrfTokenStore
impl Clone for MemoryCsrfTokenStore
Source§fn clone(&self) -> MemoryCsrfTokenStore
fn clone(&self) -> MemoryCsrfTokenStore
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 moreSource§impl CsrfTokenStore for MemoryCsrfTokenStore
impl CsrfTokenStore for MemoryCsrfTokenStore
Source§fn issue<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryCsrfTokenStore: 'async_trait,
fn issue<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryCsrfTokenStore: 'async_trait,
Issues a token bound to the given session id with the configured TTL.
Source§fn validate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
candidate: &'life2 str,
single_use: bool,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
MemoryCsrfTokenStore: 'async_trait,
fn validate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
candidate: &'life2 str,
single_use: bool,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
MemoryCsrfTokenStore: 'async_trait,
Validates a candidate token against the session id, consuming it on
success when
single_use is true.Source§impl Default for MemoryCsrfTokenStore
impl Default for MemoryCsrfTokenStore
Source§fn default() -> MemoryCsrfTokenStore
fn default() -> MemoryCsrfTokenStore
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MemoryCsrfTokenStore
impl RefUnwindSafe for MemoryCsrfTokenStore
impl Send for MemoryCsrfTokenStore
impl Sync for MemoryCsrfTokenStore
impl Unpin for MemoryCsrfTokenStore
impl UnsafeUnpin for MemoryCsrfTokenStore
impl UnwindSafe for MemoryCsrfTokenStore
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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