Skip to main content

ResponseForProtectionError

Trait ResponseForProtectionError 

Source
pub trait ResponseForProtectionError<B>: Clone {
    // Required method
    fn response_for_protection_error(
        &mut self,
        error: ProtectionError,
    ) -> Response<B>;
}
Available on crate feature csrf only.
Expand description

Builds the response returned by Csrf when a request fails CSRF protection.

Implemented for any FnMut(ProtectionError) -> Response<B> + Clone, so a closure can be passed directly to CsrfLayer::with_rejection_response.

Required Methods§

Source

fn response_for_protection_error( &mut self, error: ProtectionError, ) -> Response<B>

Builds the response from the rejection error.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§