[][src]Struct rocket::http::hyper::header::Origin

pub struct Origin {
    pub scheme: String,
    pub host: Host,

The Origin header.

The Origin header is a version of the Referer header that is used for all HTTP fetches and POSTs whose CORS flag is set. This header is often used to inform recipients of the security context of where the request was initiated.

Following the spec, https://fetch.spec.whatwg.org/#origin-header, the value of this header is composed of a String (scheme), header::Host (host/port)


use hyper::header::{Headers, Origin};

let mut headers = Headers::new();
    Origin::new("http", "hyper.rs", None)
use hyper::header::{Headers, Origin};

let mut headers = Headers::new();
    Origin::new("https", "wikipedia.org", Some(443))


scheme: String

The scheme, such as http or https

host: Host

The host, such as Host{hostname: "hyper.rs".to_owned(), port: None}


impl Origin[src]

pub fn new<S, H>(scheme: S, hostname: H, port: Option<u16>) -> Origin where
    H: Into<String>,
    S: Into<String>, 

Creates a new Origin header.

Trait Implementations

impl From<Origin> for Header<'static>

impl Clone for Origin[src]

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

Performs copy-assignment from source. Read more

impl PartialEq<Origin> for Origin[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl Display for Origin[src]

impl HeaderFormat for Origin[src]

impl Header 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.

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> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 

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

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

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

impl<T> HeaderClone for T where
    T: Sealed, 

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.

impl<T> IntoCollection<T> for T

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