pub trait CsrfExt {
// Required methods
fn csrf_token<C, R>(self, clock: &C, rng: R) -> (CsrfToken, Self)
where R: RngCore,
C: Clock;
fn verify_form<C, T>(
&self,
clock: &C,
form: ProtectedForm<T>,
) -> Result<T, CsrfError>
where C: Clock;
}
Required Methods§
Sourcefn csrf_token<C, R>(self, clock: &C, rng: R) -> (CsrfToken, Self)
fn csrf_token<C, R>(self, clock: &C, rng: R) -> (CsrfToken, Self)
Get the current CSRF token out of the cookie jar, generating a new one if necessary
Sourcefn verify_form<C, T>(
&self,
clock: &C,
form: ProtectedForm<T>,
) -> Result<T, CsrfError>where
C: Clock,
fn verify_form<C, T>(
&self,
clock: &C,
form: ProtectedForm<T>,
) -> Result<T, CsrfError>where
C: Clock,
Verify that the given CSRF-protected form is valid, returning the inner value
§Errors
Returns an error if the CSRF cookie is missing or if the value in the form is invalid
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.