[−][src]Enum actix_redis::SameSite
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
.
If the SameSite
attribute is "None", the cookie is sent in all cross-site
requests if the "Secure" flag is also set, otherwise the cookie is ignored.
This library automatically sets the "Secure" flag on cookies when
same_site
is set to SameSite::None
as long as secure
is not explicitly
set to false
.
If the SameSite
attribute is not present (by not setting SameSite
initally or passing None
to Cookie::set_same_site()
), then the cookie
will be sent as normal.
Note: This cookie attribute is an HTTP draft! Its meaning and definition are subject to change.
Variants
The "Strict" SameSite
attribute.
The "Lax" SameSite
attribute.
The "None" SameSite
attribute.
Implementations
impl SameSite
[src]
pub fn is_strict(&self) -> bool
[src]
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()); assert!(!strict.is_none());
pub fn is_lax(&self) -> bool
[src]
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()); assert!(!lax.is_none());
pub fn is_none(&self) -> bool
[src]
Returns true
if self
is SameSite::None
and false
otherwise.
Example
use cookie::SameSite; let none = SameSite::None; assert!(none.is_none()); assert!(!none.is_lax()); assert!(!none.is_strict());
Trait Implementations
impl Clone for SameSite
[src]
impl Copy for SameSite
[src]
impl Debug for SameSite
[src]
impl Display for SameSite
[src]
impl Eq for SameSite
[src]
impl Hash for SameSite
[src]
pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
__H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<SameSite> for SameSite
[src]
pub fn eq(&self, other: &SameSite) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for SameSite
[src]
impl StructuralPartialEq for SameSite
[src]
Auto Trait Implementations
impl RefUnwindSafe for SameSite
[src]
impl Send for SameSite
[src]
impl Sync for SameSite
[src]
impl Unpin for SameSite
[src]
impl UnwindSafe for SameSite
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,