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]
fn clone(&self) -> AccessControlAllowOrigin
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl PartialEq for AccessControlAllowOrigin
[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
This method tests for !=
.
impl Debug for AccessControlAllowOrigin
[src]
impl Header for AccessControlAllowOrigin
[src]
fn header_name() -> &'static str
Returns the name of the header field this belongs to. Read more
fn parse_header(raw: &[Vec<u8>]) -> Result<AccessControlAllowOrigin>
Parse a header from a raw stream of bytes. Read more
impl HeaderFormat for AccessControlAllowOrigin
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
Format a header to be output into a TcpStream. Read more