pub struct CspBuilder { /* private fields */ }Expand description
Builder for ContentSecurityPolicy.
Add directives with methods like default_src,
script_src, etc., then call build.
Implementations§
Source§impl CspBuilder
impl CspBuilder
pub fn default_src(self, sources: impl Into<Vec<CspSource>>) -> Self
pub fn script_src(self, sources: impl Into<Vec<CspSource>>) -> Self
pub fn style_src(self, sources: impl Into<Vec<CspSource>>) -> Self
pub fn img_src(self, sources: impl Into<Vec<CspSource>>) -> Self
pub fn font_src(self, sources: impl Into<Vec<CspSource>>) -> Self
pub fn connect_src(self, sources: impl Into<Vec<CspSource>>) -> Self
pub fn frame_src(self, sources: impl Into<Vec<CspSource>>) -> Self
pub fn frame_ancestors(self, sources: impl Into<Vec<CspSource>>) -> Self
pub fn base_uri(self, sources: impl Into<Vec<CspSource>>) -> Self
pub fn form_action(self, sources: impl Into<Vec<CspSource>>) -> Self
pub fn upgrade_insecure_requests(self) -> Self
pub fn build(self) -> ContentSecurityPolicy
Trait Implementations§
Source§impl IntoSecurityHeader for CspBuilder
impl IntoSecurityHeader for CspBuilder
fn into_header(self) -> (HeaderName, HeaderValue)
Auto Trait Implementations§
impl Freeze for CspBuilder
impl RefUnwindSafe for CspBuilder
impl Send for CspBuilder
impl Sync for CspBuilder
impl Unpin for CspBuilder
impl UnsafeUnpin for CspBuilder
impl UnwindSafe for CspBuilder
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