pub struct StrictTransportSecurity { /* private fields */ }
Expand description
Manages Strict-Transport-Security
header
The Strict-Transport-Security HTTP response header (often abbreviated as HSTS) lets a web site tell browsers that it should only be accessed using HTTPS, instead of using HTTP.
§Values
- max-age: The time, in seconds, that the browser should remember that a site is only to be accessed using HTTPS.
- includeSubDomains: If this optional parameter is specified, this rule applies to all of the site’s subdomains as well.
- preload: If this optional parameter is specified, this rule applies to all of the site’s subdomains as well.
§Examples
use helmet_core::StrictTransportSecurity;
let strict_transport_security = StrictTransportSecurity::default();
let custom_strict_transport_security = StrictTransportSecurity::default()
.max_age(31536000)
.include_sub_domains()
.preload();
Implementations§
Trait Implementations§
Source§impl Clone for StrictTransportSecurity
impl Clone for StrictTransportSecurity
Source§fn clone(&self) -> StrictTransportSecurity
fn clone(&self) -> StrictTransportSecurity
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 Default for StrictTransportSecurity
impl Default for StrictTransportSecurity
Source§impl Display for StrictTransportSecurity
impl Display for StrictTransportSecurity
Auto Trait Implementations§
impl Freeze for StrictTransportSecurity
impl RefUnwindSafe for StrictTransportSecurity
impl Send for StrictTransportSecurity
impl Sync for StrictTransportSecurity
impl Unpin for StrictTransportSecurity
impl UnwindSafe for StrictTransportSecurity
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