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§
source§impl AccessControlAllowOrigin
impl AccessControlAllowOrigin
sourcepub const ANY: AccessControlAllowOrigin = _
pub const ANY: AccessControlAllowOrigin = _
Access-Control-Allow-Origin: *
sourcepub const NULL: AccessControlAllowOrigin = _
pub const NULL: AccessControlAllowOrigin = _
Access-Control-Allow-Origin: null
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 Hash for AccessControlAllowOrigin
impl Hash for AccessControlAllowOrigin
source§impl Header for AccessControlAllowOrigin
impl Header for AccessControlAllowOrigin
source§impl PartialEq<AccessControlAllowOrigin> for AccessControlAllowOrigin
impl PartialEq<AccessControlAllowOrigin> for AccessControlAllowOrigin
source§fn eq(&self, other: &AccessControlAllowOrigin) -> bool
fn eq(&self, other: &AccessControlAllowOrigin) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.