pub struct CsrfToken {
pub(crate) token: String,
pub(crate) config: CsrfConfig,
}
Expand description
This is the Token that is generated when a user is routed to a page. If a Cookie exists then it will be used as the Token. Otherwise a new one is made.
Fields§
§token: String
§config: CsrfConfig
Implementations§
Trait Implementations§
Source§impl<S> FromRequestParts<S> for CsrfToken
Available on crate feature layer
only.
impl<S> FromRequestParts<S> for CsrfToken
Available on crate feature
layer
only.Source§impl IntoResponse for CsrfToken
impl IntoResponse for CsrfToken
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Create a response.
Source§impl IntoResponseParts for CsrfToken
impl IntoResponseParts for CsrfToken
Source§type Error = Infallible
type Error = Infallible
The type returned in the event of an error. Read more
Source§fn into_response_parts(
self,
res: ResponseParts,
) -> Result<ResponseParts, Self::Error>
fn into_response_parts( self, res: ResponseParts, ) -> Result<ResponseParts, Self::Error>
Set parts of the response
Auto Trait Implementations§
impl Freeze for CsrfToken
impl RefUnwindSafe for CsrfToken
impl Send for CsrfToken
impl Sync for CsrfToken
impl Unpin for CsrfToken
impl UnwindSafe for CsrfToken
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<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.