pub struct SecurityHeader {
pub referer_policy: RefererPolicy,
pub x_frame_options: XFrameOptions,
pub x_xss_protection: XXSSProtection,
pub cross_origin_opener_policy: CrossOriginOpenerPolicy,
pub content_security_policy: String,
pub strict_transport_security: Option<StrictTransportSecurity>,
}
Available on crate feature
security
only.Fields§
§referer_policy: RefererPolicy
§x_frame_options: XFrameOptions
§x_xss_protection: XXSSProtection
§cross_origin_opener_policy: CrossOriginOpenerPolicy
§content_security_policy: String
§strict_transport_security: Option<StrictTransportSecurity>
Implementations§
Source§impl SecurityHeader
impl SecurityHeader
Sourcepub fn set_default_hsts(&mut self)
pub fn set_default_hsts(&mut self)
Set default HSTS to 1 year, includeSubDomains and preload.
max-age=31536000; includeSubDomains; preload
pub fn build(self) -> DefaultHeaders
Trait Implementations§
Source§impl Clone for SecurityHeader
impl Clone for SecurityHeader
Source§fn clone(&self) -> SecurityHeader
fn clone(&self) -> SecurityHeader
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 SecurityHeader
impl Debug for SecurityHeader
Source§impl Default for SecurityHeader
impl Default for SecurityHeader
Source§impl<'de> Deserialize<'de> for SecurityHeader
impl<'de> Deserialize<'de> for SecurityHeader
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SecurityHeader
impl RefUnwindSafe for SecurityHeader
impl Send for SecurityHeader
impl Sync for SecurityHeader
impl Unpin for SecurityHeader
impl UnwindSafe for SecurityHeader
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