Struct content_security_policy::Directive
source · pub struct Directive {
pub(crate) name: String,
pub(crate) value: Vec<String>,
}
Expand description
https://www.w3.org/TR/CSP/#directives
Fields§
§name: String
§value: Vec<String>
Implementations§
source§impl Directive
impl Directive
sourcepub fn pre_request_check(
&self,
request: &Request,
policy: &Policy,
) -> CheckResult
pub fn pre_request_check( &self, request: &Request, policy: &Policy, ) -> CheckResult
https://www.w3.org/TR/CSP/#directive-pre-request-check
sourcepub fn post_request_check(
&self,
request: &Request,
response: &Response,
policy: &Policy,
) -> CheckResult
pub fn post_request_check( &self, request: &Request, response: &Response, policy: &Policy, ) -> CheckResult
https://www.w3.org/TR/CSP/#directive-post-request-check
sourcepub fn response_check(
&self,
request: &Request,
_response: &Response,
policy: &Policy,
) -> CheckResult
pub fn response_check( &self, request: &Request, _response: &Response, policy: &Policy, ) -> CheckResult
https://www.w3.org/TR/CSP/#directive-response-check
sourcepub fn inline_check(
&self,
element: &Element<'_>,
type_: InlineCheckType,
policy: &Policy,
source: &str,
) -> CheckResult
pub fn inline_check( &self, element: &Element<'_>, type_: InlineCheckType, policy: &Policy, source: &str, ) -> CheckResult
https://www.w3.org/TR/CSP/#directive-inline-check
sourcepub fn get_sandboxing_flag_set_for_document(
&self,
policy: &Policy,
) -> Option<SandboxingFlagSet>
pub fn get_sandboxing_flag_set_for_document( &self, policy: &Policy, ) -> Option<SandboxingFlagSet>
https://www.w3.org/TR/CSP/#sandbox-init
sourcepub fn is_js_evaluation_allowed(&self, policy: &Policy) -> CheckResult
pub fn is_js_evaluation_allowed(&self, policy: &Policy) -> CheckResult
https://www.w3.org/TR/CSP/#can-compile-strings
sourcepub fn is_wasm_evaluation_allowed(&self, policy: &Policy) -> CheckResult
pub fn is_wasm_evaluation_allowed(&self, policy: &Policy) -> CheckResult
https://www.w3.org/TR/CSP/#can-compile-wasm-bytes
Trait Implementations§
source§impl<'de> Deserialize<'de> for Directive
impl<'de> Deserialize<'de> for Directive
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
source§impl PartialEq for Directive
impl PartialEq for Directive
impl Eq for Directive
impl StructuralPartialEq for Directive
Auto Trait Implementations§
impl Freeze for Directive
impl RefUnwindSafe for Directive
impl Send for Directive
impl Sync for Directive
impl Unpin for Directive
impl UnwindSafe for Directive
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