Enum hyper::header::AccessControlAllowOrigin
[−]
[src]
pub enum AccessControlAllowOrigin { Any, Null, Value(String), }
The Access-Control-Allow-Origin
response header,
part of CORS
The Access-Control-Allow-Origin
header indicates whether a resource
can be shared based by returning the value of the Origin request header,
*
, or null
in the response.
ABNF
Access-Control-Allow-Origin = "Access-Control-Allow-Origin" ":" origin-list-or-null | "*"
Example values
null
*
http://google.com/
Examples
use hyper::header::{Headers, AccessControlAllowOrigin}; let mut headers = Headers::new(); headers.set( AccessControlAllowOrigin::Any );
use hyper::header::{Headers, AccessControlAllowOrigin}; let mut headers = Headers::new(); headers.set( AccessControlAllowOrigin::Null, );
use hyper::header::{Headers, AccessControlAllowOrigin}; let mut headers = Headers::new(); headers.set( AccessControlAllowOrigin::Value("http://hyper.rs".to_owned()) );
Variants
Any
Allow all origins
Null
A hidden origin
Value(String)
Allow one particular origin
Trait Implementations
impl Clone for AccessControlAllowOrigin
[src]
impl Clone for AccessControlAllowOrigin
fn clone(&self) -> AccessControlAllowOrigin
[src]
fn clone(&self) -> AccessControlAllowOrigin
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl PartialEq for AccessControlAllowOrigin
[src]
impl PartialEq for AccessControlAllowOrigin
fn eq(&self, __arg_0: &AccessControlAllowOrigin) -> bool
[src]
fn eq(&self, __arg_0: &AccessControlAllowOrigin) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &AccessControlAllowOrigin) -> bool
[src]
fn ne(&self, __arg_0: &AccessControlAllowOrigin) -> bool
This method tests for !=
.
impl Debug for AccessControlAllowOrigin
[src]
impl Debug for AccessControlAllowOrigin
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Header for AccessControlAllowOrigin
[src]
impl Header for AccessControlAllowOrigin
fn header_name() -> &'static str
[src]
fn header_name() -> &'static str
Returns the name of the header field this belongs to. Read more
fn parse_header(raw: &Raw) -> Result<AccessControlAllowOrigin>
[src]
fn parse_header(raw: &Raw) -> Result<AccessControlAllowOrigin>
Parse a header from a raw stream of bytes. Read more
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
Format a header to outgoing stream. Read more
impl Display for AccessControlAllowOrigin
[src]
impl Display for AccessControlAllowOrigin
Auto Trait Implementations
impl Send for AccessControlAllowOrigin
impl Send for AccessControlAllowOrigin
impl Sync for AccessControlAllowOrigin
impl Sync for AccessControlAllowOrigin