pub struct CsrfService { /* private fields */ }Expand description
CSRF 服务
Implementations§
Source§impl CsrfService
impl CsrfService
Sourcepub fn new(config: CsrfConfig) -> Self
pub fn new(config: CsrfConfig) -> Self
Sourcepub async fn generate_token(&self, session_id: &str) -> CsrfResult<CsrfToken>
pub async fn generate_token(&self, session_id: &str) -> CsrfResult<CsrfToken>
Sourcepub async fn validate_token(
&self,
session_id: &str,
token: &str,
) -> CsrfResult<bool>
pub async fn validate_token( &self, session_id: &str, token: &str, ) -> CsrfResult<bool>
Sourcepub async fn revoke_token(&self, session_id: &str)
pub async fn revoke_token(&self, session_id: &str)
Sourcepub fn config(&self) -> &CsrfConfig
pub fn config(&self) -> &CsrfConfig
获取配置
Trait Implementations§
Source§impl Clone for CsrfService
impl Clone for CsrfService
Source§fn clone(&self) -> CsrfService
fn clone(&self) -> CsrfService
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 moreSource§impl Debug for CsrfService
impl Debug for CsrfService
Auto Trait Implementations§
impl Freeze for CsrfService
impl !RefUnwindSafe for CsrfService
impl Send for CsrfService
impl Sync for CsrfService
impl Unpin for CsrfService
impl UnsafeUnpin for CsrfService
impl !UnwindSafe for CsrfService
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