pub struct CSP<'a>(/* private fields */);
Expand description
The starting point for building a Content Security Policy.
You’ll add Directive
into this struct, and later on call .to_string()
on it to get it as a header compatible string. Doesn’t include
content-security-policy: part in it though.
Implementations§
Source§impl<'a> CSP<'a>
impl<'a> CSP<'a>
pub fn add_borrowed<'b>(&'b mut self, directive: Directive<'a>) -> &'b mut Self
👎Deprecated since 1.0.0: please use
push_borrowed
insteadSourcepub fn push_borrowed<'b>(&'b mut self, directive: Directive<'a>) -> &'b mut Self
pub fn push_borrowed<'b>(&'b mut self, directive: Directive<'a>) -> &'b mut Self
Pushes a directive to the end of the borrowed CSP
pub fn add(self, directive: Directive<'a>) -> Self
👎Deprecated since 1.0.0: please use
push
insteadTrait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for CSP<'a>
impl<'a> RefUnwindSafe for CSP<'a>
impl<'a> Send for CSP<'a>
impl<'a> Sync for CSP<'a>
impl<'a> Unpin for CSP<'a>
impl<'a> UnwindSafe for CSP<'a>
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