pub enum AccessControlAllowOrigin {
Any,
Null,
Value(String),
}
Expand description
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§
Trait Implementations§
Source§impl Clone for AccessControlAllowOrigin
impl Clone for AccessControlAllowOrigin
Source§fn clone(&self) -> AccessControlAllowOrigin
fn clone(&self) -> AccessControlAllowOrigin
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for AccessControlAllowOrigin
impl Debug for AccessControlAllowOrigin
Source§impl Display for AccessControlAllowOrigin
impl Display for AccessControlAllowOrigin
Source§impl Header for AccessControlAllowOrigin
impl Header for AccessControlAllowOrigin
Source§fn header_name() -> &'static str
fn header_name() -> &'static str
Returns the name of the header field this belongs to. Read more
Source§fn parse_header(raw: &Raw) -> Result<AccessControlAllowOrigin>
fn parse_header(raw: &Raw) -> Result<AccessControlAllowOrigin>
Parse a header from a raw stream of bytes. Read more
Source§impl PartialEq for AccessControlAllowOrigin
impl PartialEq for AccessControlAllowOrigin
impl StructuralPartialEq for AccessControlAllowOrigin
Auto Trait Implementations§
impl Freeze for AccessControlAllowOrigin
impl RefUnwindSafe for AccessControlAllowOrigin
impl Send for AccessControlAllowOrigin
impl Sync for AccessControlAllowOrigin
impl Unpin for AccessControlAllowOrigin
impl UnwindSafe for AccessControlAllowOrigin
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)