Struct headers::AccessControlAllowOrigin [−][src]
pub struct AccessControlAllowOrigin(_);
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 headers::AccessControlAllowOrigin;
use std::convert::TryFrom;
let any_origin = AccessControlAllowOrigin::ANY;
let null_origin = AccessControlAllowOrigin::NULL;
let origin = AccessControlAllowOrigin::try_from("http://web-platform.test:8000");
Implementations
Access-Control-Allow-Origin: *
Access-Control-Allow-Origin: null
Trait Implementations
The name of this header.
Decode this type from an iterator of HeaderValue
s.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for AccessControlAllowOrigin
impl Send for AccessControlAllowOrigin
impl Sync for AccessControlAllowOrigin
impl Unpin for AccessControlAllowOrigin
impl UnwindSafe for AccessControlAllowOrigin
Blanket Implementations
Mutably borrows from an owned value. Read more