pub struct CspNonce(pub String);Expand description
Per-request CSP nonce inserted into request extensions when
SecurityHeaders::csp_with_nonce is configured.
Handlers can substitute the value into inline scripts:
ⓘ
let nonce = req.extensions().get::<CspNonce>().expect("CSP middleware mounted").0.clone();
let html = format!(r#"<script nonce="{nonce}">…</script>"#);Tuple Fields§
§0: StringTrait Implementations§
Auto Trait Implementations§
impl Freeze for CspNonce
impl RefUnwindSafe for CspNonce
impl Send for CspNonce
impl Sync for CspNonce
impl Unpin for CspNonce
impl UnsafeUnpin for CspNonce
impl UnwindSafe for CspNonce
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