Struct headers::AccessControlAllowOrigin
source · pub struct AccessControlAllowOrigin(/* private fields */);
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 for AccessControlAllowOrigin
impl PartialEq for AccessControlAllowOrigin
source§impl TryFrom<&str> for AccessControlAllowOrigin
impl TryFrom<&str> for AccessControlAllowOrigin
impl Eq 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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)