pub enum CrossOriginOpenerPolicy {
SameOrigin,
SameOriginAllowPopups,
UnsafeNone,
}Expand description
Manages Cross-Origin-Opener-Policy header
The Cross-Origin-Opener-Policy HTTP response header restricts how selected resources are allowed to interact with the document’s browsing context in response to user navigation. Each resource can declare an opener policy which applies to the resource’s corresponding browsing context.
§Values
- same-origin: The resource’s browsing context is the same-origin as the document’s browsing context.
- same-origin-allow-popups: The resource’s browsing context is the same-origin as the document’s browsing context, and the resource is allowed to open new browsing contexts.
- unsafe-none: The resource’s browsing context is cross-origin with the document’s browsing context.
§Examples
use helmet_core::CrossOriginOpenerPolicy;
let cross_origin_opener_policy = CrossOriginOpenerPolicy::same_origin();Variants§
Implementations§
Source§impl CrossOriginOpenerPolicy
impl CrossOriginOpenerPolicy
pub fn same_origin() -> Self
pub fn same_origin_allow_popups() -> Self
pub fn unsafe_none() -> Self
Trait Implementations§
Source§impl Clone for CrossOriginOpenerPolicy
impl Clone for CrossOriginOpenerPolicy
Source§fn clone(&self) -> CrossOriginOpenerPolicy
fn clone(&self) -> CrossOriginOpenerPolicy
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 CrossOriginOpenerPolicy
impl RefUnwindSafe for CrossOriginOpenerPolicy
impl Send for CrossOriginOpenerPolicy
impl Sync for CrossOriginOpenerPolicy
impl Unpin for CrossOriginOpenerPolicy
impl UnwindSafe for CrossOriginOpenerPolicy
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