[−][src]Struct rocket_http::hyper::header::Origin
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)
Examples
use hyper::header::{Headers, Origin}; let mut headers = Headers::new(); headers.set( Origin::new("http", "hyper.rs", None) );
use hyper::header::{Headers, Origin}; let mut headers = Headers::new(); headers.set( Origin::new("https", "wikipedia.org", Some(443)) );
Fields
scheme: String
The scheme, such as http or https
host: Host
The host, such as Host{hostname: "hyper.rs".to_owned(), port: None}
Methods
impl Origin[src]
impl Originpub fn new<S, H>(scheme: S, hostname: H, port: Option<u16>) -> Origin where
H: Into<String>,
S: Into<String>, [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 PartialEq<Origin> for Origin[src]
impl PartialEq<Origin> for Originfn eq(&self, other: &Origin) -> bool[src]
fn eq(&self, other: &Origin) -> bool#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl Display for Origin[src]
impl Display for Originimpl Debug for Origin[src]
impl Debug for Originimpl Clone for Origin[src]
impl Clone for Originfn clone(&self) -> Origin[src]
fn clone(&self) -> Originfn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl FromStr for Origin[src]
impl FromStr for Origintype Err = Error
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Origin, Error>[src]
fn from_str(s: &str) -> Result<Origin, Error>impl HeaderFormat for Origin[src]
impl HeaderFormat for Originimpl Header for Origin[src]
impl Header for Originimpl From<Origin> for Header<'static>[src]
impl From<Origin> for Header<'static>Auto Trait Implementations
Blanket Implementations
impl<T> IntoCollection for T[src]
impl<T> IntoCollection for TⓘImportant traits for SmallVec<A>fn into_collection<A>(Self) -> SmallVec<A> where
A: Array<Item = T>, [src]
fn into_collection<A>(Self) -> SmallVec<A> where
A: Array<Item = T>, ⓘImportant traits for SmallVec<A>fn mapped<U, F, A>(Self, F) -> SmallVec<A> where
A: Array<Item = U>,
F: FnMut(T) -> U, [src]
fn mapped<U, F, A>(Self, F) -> SmallVec<A> where
A: Array<Item = U>,
F: FnMut(T) -> U, impl<T> From for T[src]
impl<T> From for Timpl<T, U> Into for T where
U: From<T>, [src]
impl<T, U> Into for T where
U: From<T>, impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, impl<T> ToString for T where
T: Display + ?Sized, [src]
impl<T> ToString for T where
T: Display + ?Sized, impl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, impl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, fn borrow_mut(&mut self) -> &mut T[src]
fn borrow_mut(&mut self) -> &mut Timpl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
U: TryFrom<T>, type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>impl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&self) -> TypeId[src]
fn get_type_id(&self) -> TypeIdimpl<T, I> AsResult for T where
I: Input, [src]
impl<T, I> AsResult for T where
I: Input, impl<T> HeaderClone for T where
T: Sealed, [src]
impl<T> HeaderClone for T where
T: Sealed, impl<T> Typeable for T where
T: Any, [src]
impl<T> Typeable for T where
T: Any,