pub struct Token { /* private fields */ }Expand description
An extension providing a way to interact with a visitor’s CSRF token.
Implementations§
Source§impl Token
impl Token
Sourcepub fn set(&self, identifier: impl Into<String>) -> Result<(), Error>
pub fn set(&self, identifier: impl Into<String>) -> Result<(), Error>
Updates the identifier used to sign the token. The value should only be valid for the duration of the user’s authenticated session and should be unique to that session.
See: OWASP’s CSRF Prevention Cheat Sheet.
§Errors
Trait Implementations§
Source§impl<S> FromRequestParts<S> for Token
impl<S> FromRequestParts<S> for Token
Source§type Rejection = (StatusCode, String)
type Rejection = (StatusCode, String)
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.
Auto Trait Implementations§
impl !RefUnwindSafe for Token
impl !UnwindSafe for Token
impl Freeze for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnsafeUnpin for Token
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S, T> FromRequest<S, ViaParts> for T
impl<S, T> FromRequest<S, ViaParts> for T
Source§type Rejection = <T as FromRequestParts<S>>::Rejection
type Rejection = <T as FromRequestParts<S>>::Rejection
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.