Struct tower_surf::Token
source · 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
§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 Freeze for Token
impl !RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl !UnwindSafe 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<S, T> FromRequest<S, ViaParts> for T
impl<S, T> FromRequest<S, ViaParts> for T
§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.