Enum cookie::SameSite [−][src]
pub enum SameSite { Strict, Lax, }
The SameSite
cookie attribute.
A cookie with a SameSite
attribute is imposed restrictions on when it is
sent to the origin server in a cross-site request. If the SameSite
attribute is "Strict", then the cookie is never sent in cross-site requests.
If the SameSite
attribute is "Lax", the cookie is only sent in cross-site
requests with "safe" HTTP methods, i.e, GET
, HEAD
, OPTIONS
, TRACE
.
Note: This cookie attribute is an HTTP draft! Its meaning and definition are subject to change.
Variants
Strict
The "Strict" SameSite
attribute.
Lax
The "Lax" SameSite
attribute.
Methods
impl SameSite
[src]
impl SameSite
pub fn is_strict(&self) -> bool
[src]
pub fn is_strict(&self) -> bool
Returns true
if self
is SameSite::Strict
and false
otherwise.
Example
use cookie::SameSite; let strict = SameSite::Strict; assert!(strict.is_strict()); assert!(!strict.is_lax());
pub fn is_lax(&self) -> bool
[src]
pub fn is_lax(&self) -> bool
Returns true
if self
is SameSite::Lax
and false
otherwise.
Example
use cookie::SameSite; let lax = SameSite::Lax; assert!(lax.is_lax()); assert!(!lax.is_strict());
Trait Implementations
impl Debug for SameSite
[src]
impl Debug for SameSite
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for SameSite
[src]
impl Clone for SameSite
fn clone(&self) -> SameSite
[src]
fn clone(&self) -> SameSite
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Copy for SameSite
[src]
impl Copy for SameSite
impl PartialEq for SameSite
[src]
impl PartialEq for SameSite
fn eq(&self, other: &SameSite) -> bool
[src]
fn eq(&self, other: &SameSite) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl Eq for SameSite
[src]
impl Eq for SameSite
impl Hash for SameSite
[src]
impl Hash for SameSite
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Display for SameSite
[src]
impl Display for SameSite