pub struct Csrf { /* private fields */ }Expand description
CSRF middleware, see the module docs
Implementations§
Source§impl Csrf
impl Csrf
pub fn new() -> Self
Sourcepub fn header_name(self, name: impl Into<String>) -> Self
pub fn header_name(self, name: impl Into<String>) -> Self
Name of the header carrying the token (default x-csrf-token)
Sourcepub fn field_name(self, name: impl Into<String>) -> Self
pub fn field_name(self, name: impl Into<String>) -> Self
Name of the form field carrying the token (default csrf_token)
Sourcepub fn allow_origin(self, origin: impl Into<String>) -> Self
pub fn allow_origin(self, origin: impl Into<String>) -> Self
Accept requests from this origin too, e.g. https://admin.example.com
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Csrf
impl !UnwindSafe for Csrf
impl Freeze for Csrf
impl Send for Csrf
impl Sync for Csrf
impl Unpin for Csrf
impl UnsafeUnpin for Csrf
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