pub enum CrossOriginEmbedderPolicy {
UnsafeNone,
RequireCorp,
Credentialless,
}Expand description
Manages Cross-Origin-Embedder-Policy header
The Cross-Origin-Embedder-Policy HTTP response header prevents a document from loading any cross-origin resources that do not explicitly grant the document permission (via CORS headers) to load them.
§Values
- unsafe-none: The document is not subject to any Cross-Origin-Embedder-Policy restrictions.
- require-corp: The document is subject to Cross-Origin-Embedder-Policy restrictions.
- credentialless: The document is subject to Cross-Origin-Embedder-Policy restrictions, and is not allowed to request credentials (e.g. cookies, certificates, HTTP authentication) from the user.
§Examples
use helmet_core::CrossOriginEmbedderPolicy;
let cross_origin_embedder_policy = CrossOriginEmbedderPolicy::unsafe_none();
let cross_origin_embedder_policy = CrossOriginEmbedderPolicy::require_corp();
let cross_origin_embedder_policy = CrossOriginEmbedderPolicy::credentialless();Variants§
Implementations§
Source§impl CrossOriginEmbedderPolicy
impl CrossOriginEmbedderPolicy
pub fn unsafe_none() -> Self
pub fn require_corp() -> Self
pub fn credentialless() -> Self
Trait Implementations§
Source§impl Clone for CrossOriginEmbedderPolicy
impl Clone for CrossOriginEmbedderPolicy
Source§fn clone(&self) -> CrossOriginEmbedderPolicy
fn clone(&self) -> CrossOriginEmbedderPolicy
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for CrossOriginEmbedderPolicy
impl RefUnwindSafe for CrossOriginEmbedderPolicy
impl Send for CrossOriginEmbedderPolicy
impl Sync for CrossOriginEmbedderPolicy
impl Unpin for CrossOriginEmbedderPolicy
impl UnwindSafe for CrossOriginEmbedderPolicy
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