Enum rocket_http::SameSite [−][src]
pub enum SameSite { Strict, Lax, None, }
Expand description
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 not present (made explicit via the
SameSite::None
variant), 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.
No SameSite
attribute.
Implementations
impl SameSite
[src]
impl SameSite
[src]pub fn is_strict(&self) -> bool
[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());
Trait Implementations
impl Copy for SameSite
[src]
impl Eq for SameSite
[src]
impl StructuralEq for SameSite
[src]
impl StructuralPartialEq for SameSite
[src]
Auto Trait Implementations
impl RefUnwindSafe for SameSite
impl Send for SameSite
impl Sync for SameSite
impl Unpin for SameSite
impl UnwindSafe for SameSite
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
[src]
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
[src]pub fn equivalent(&self, key: &K) -> bool
[src]
pub fn equivalent(&self, key: &K) -> bool
[src]Compare self to key
and return true
if they are equal.
impl<T> IntoCollection<T> for T
[src]
impl<T> IntoCollection<T> for T
[src]impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more