pub struct TokenField { /* private fields */ }Expand description
The anti-forgery token field to capture from a multipart body.
§Examples
use form_net::{TokenField, TokenPlacement};
let strict = TokenField::new("csrf_token");
assert_eq!(strict.placement(), TokenPlacement::BeforeFirstFile);
assert_eq!(strict.anywhere().placement(), TokenPlacement::Anywhere);Implementations§
Source§impl TokenField
impl TokenField
Sourcepub const fn new(name: &'static str) -> TokenField
pub const fn new(name: &'static str) -> TokenField
A token field named name that must come before the first file.
Sourcepub const fn anywhere(self) -> TokenField
pub const fn anywhere(self) -> TokenField
The same field, allowed anywhere in the body.
Sourcepub const fn placement(&self) -> TokenPlacement
pub const fn placement(&self) -> TokenPlacement
Where the field must be.
Trait Implementations§
Source§impl Clone for TokenField
impl Clone for TokenField
impl Copy for TokenField
Source§impl Debug for TokenField
impl Debug for TokenField
impl Eq for TokenField
Source§impl PartialEq for TokenField
impl PartialEq for TokenField
impl StructuralPartialEq for TokenField
Auto Trait Implementations§
impl Freeze for TokenField
impl RefUnwindSafe for TokenField
impl Send for TokenField
impl Sync for TokenField
impl Unpin for TokenField
impl UnsafeUnpin for TokenField
impl UnwindSafe for TokenField
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