pub struct CsrfToken { /* private fields */ }
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.
Implementations§
Trait Implementations§
source§impl<S> FromRequestParts<S> for CsrfTokenwhere
S: Send + Sync,
CsrfConfig: FromRef<S>,
impl<S> FromRequestParts<S> for CsrfTokenwhere S: Send + Sync, CsrfConfig: FromRef<S>,
this auto pulls a Cookies nd Generates the CsrfToken from the extensions
§type Rejection = (StatusCode, &'static str)
type Rejection = (StatusCode, &'static str)
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.
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
§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 RefUnwindSafe for CsrfToken
impl Send for CsrfToken
impl Sync for CsrfToken
impl Unpin for CsrfToken
impl UnwindSafe for CsrfToken
Blanket Implementations§
source§impl<S, B, T> FromRequest<S, B, ViaParts> for Twhere
B: Send + 'static,
S: Send + Sync,
T: FromRequestParts<S>,
impl<S, B, T> FromRequest<S, B, ViaParts> for Twhere B: Send + 'static, S: Send + Sync, T: FromRequestParts<S>,
§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.