[][src]Enum rocket_cors::headers::Origin

pub enum Origin {
    Null,
    Parsed(Origin),
    Opaque(String),
}

The Origin request header used in CORS

You can use this as a rocket Request Guard to ensure that Origin is passed in correctly.

Reference: Mozilla

Variants

Null

A null Origin

Parsed(Origin)

A well-formed origin that was parsed by url::Url::origin

Opaque(String)

An unknown "opaque" origin that could not be parsed

Methods

impl Origin[src]

pub fn ascii_serialization(&self) -> String[src]

Perform an ASCII serialization of this origin.

pub fn is_tuple(&self) -> bool[src]

Returns whether the origin was parsed as non-opaque

Trait Implementations

impl Clone for Origin[src]

impl Eq for Origin[src]

impl PartialEq<Origin> for Origin[src]

impl Display for Origin[src]

impl Debug for Origin[src]

impl FromStr for Origin[src]

type Err = Error

The associated error which can be returned from parsing.

impl Hash for Origin[src]

impl StructuralPartialEq for Origin[src]

impl StructuralEq for Origin[src]

impl<'a, 'r> FromRequest<'a, 'r> for Origin[src]

type Error = Error

The associated error to be returned if derivation fails.

Auto Trait Implementations

impl Send for Origin

impl Sync for Origin

impl Unpin for Origin

impl UnwindSafe for Origin

impl RefUnwindSafe for Origin

Blanket Implementations

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

impl<T> From<T> for T[src]

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

type Owned = T

The resulting type after obtaining ownership.

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

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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> Borrow<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Typeable for T where
    T: Any

impl<T> IntoCollection<T> for T

impl<T, I> AsResult<T, I> for T where
    I: Input, 

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