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
§impl From<AccessControlAllowOrigin> for Header<'static>
impl From<AccessControlAllowOrigin> for Header<'static>
§fn from(header: AccessControlAllowOrigin) -> Header<'static>
fn from(header: AccessControlAllowOrigin) -> Header<'static>
Converts to this type from the input type.
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: &[Vec<u8>]) -> Result<AccessControlAllowOrigin, Error>
fn parse_header(raw: &[Vec<u8>]) -> Result<AccessControlAllowOrigin, Error>
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
)