pub struct HttpContextBuilderView<'a> { /* private fields */ }Expand description
Mutable view over one HTTP field context.
Implementations§
Source§impl HttpContextBuilderView<'_>
impl HttpContextBuilderView<'_>
Sourcepub fn replace_rules(&mut self, rules: RedactionRules) -> &mut Self
pub fn replace_rules(&mut self, rules: RedactionRules) -> &mut Self
Replaces all rules for this HTTP field context.
Sourcepub fn raise(
&mut self,
field: &str,
level: Sensitivity,
) -> Result<&mut Self, PolicyError>
pub fn raise( &mut self, field: &str, level: Sensitivity, ) -> Result<&mut Self, PolicyError>
Raises a context field’s minimum sensitivity.
§Errors
Returns PolicyError when field has no canonical name.
Sourcepub fn override_level(
&mut self,
field: &str,
level: Sensitivity,
) -> Result<&mut Self, PolicyError>
pub fn override_level( &mut self, field: &str, level: Sensitivity, ) -> Result<&mut Self, PolicyError>
Replaces a context field rule without weakening the base policy.
§Errors
Returns PolicyError when field has no canonical name.
Sourcepub fn allow_exact(&mut self, field: &str) -> Result<&mut Self, PolicyError>
pub fn allow_exact(&mut self, field: &str) -> Result<&mut Self, PolicyError>
Adds a context exact allow rule; the base policy still applies.
§Errors
Returns PolicyError when field has no canonical name.
Sourcepub fn allow_suffix(&mut self, field: &str) -> Result<&mut Self, PolicyError>
pub fn allow_suffix(&mut self, field: &str) -> Result<&mut Self, PolicyError>
Adds a context suffix allow rule; the base policy still applies.
§Errors
Returns PolicyError when field has no canonical suffix.
Sourcepub fn remove_allow_exact(
&mut self,
field: &str,
) -> Result<&mut Self, PolicyError>
pub fn remove_allow_exact( &mut self, field: &str, ) -> Result<&mut Self, PolicyError>
Sourcepub fn remove_allow_suffix(
&mut self,
field: &str,
) -> Result<&mut Self, PolicyError>
pub fn remove_allow_suffix( &mut self, field: &str, ) -> Result<&mut Self, PolicyError>
Removes a context suffix allow rule.
§Errors
Returns PolicyError when field has no canonical suffix.
Sourcepub fn clear_allow_rules(&mut self) -> &mut Self
pub fn clear_allow_rules(&mut self) -> &mut Self
Removes all context allow rules.
Sourcepub fn floor(&mut self, floor: RedactionFloor) -> &mut Self
pub fn floor(&mut self, floor: RedactionFloor) -> &mut Self
Adds a context floor. Base protection remains independently effective.
Sourcepub fn disable_floor(&mut self) -> &mut Self
pub fn disable_floor(&mut self) -> &mut Self
Disables this context’s explicit floor.