[][src]Enum rocket::http::SameSite

pub enum SameSite {
    Strict,
    Lax,
    None,
}

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

Strict

The "Strict" SameSite attribute.

Lax

The "Lax" SameSite attribute.

None

No SameSite attribute.

Methods

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 Eq for SameSite[src]

impl PartialEq<SameSite> for SameSite[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl Display for SameSite[src]

impl Hash for SameSite[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Clone for SameSite[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for SameSite[src]

impl Copy for SameSite[src]

Auto Trait Implementations

impl Send for SameSite

impl Sync for SameSite

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.

impl<T> IntoCollection for T[src]

impl<T, I> AsResult for T where
    I: Input
[src]

impl<Q, K> Equivalent for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]