pub struct HttpRedactionPolicyBuilder { /* private fields */ }Expand description
Mutable construction state for an HttpRedactionPolicy.
Implementations§
Source§impl HttpRedactionPolicyBuilder
impl HttpRedactionPolicyBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a builder with empty field policies and default HTTP behavior.
§Returns
A builder with fail-closed behavior choices and finite default limits.
Sourcepub fn load_default(self) -> Self
pub fn load_default(self) -> Self
Replaces this builder with the current default HTTP policy snapshot.
§Returns
A mutable copy of HttpRedactionPolicy::default.
§Warning
This replaces every builder component, including the header, query, and body policies, behavior choices, and budgets. Call this method before adding application-specific configuration.
Sourcepub fn from_policy(policy: &HttpRedactionPolicy) -> Self
pub fn from_policy(policy: &HttpRedactionPolicy) -> Self
Sourcepub fn header_policy(self, policy: RedactionPolicy) -> Self
pub fn header_policy(self, policy: RedactionPolicy) -> Self
Sourcepub fn query_policy(self, policy: RedactionPolicy) -> Self
pub fn query_policy(self, policy: RedactionPolicy) -> Self
Sourcepub fn body_policy(self, policy: RedactionPolicy) -> Self
pub fn body_policy(self, policy: RedactionPolicy) -> Self
Sourcepub fn raise_header(self, name: &str, level: Sensitivity) -> Self
pub fn raise_header(self, name: &str, level: Sensitivity) -> Self
Sourcepub fn override_header(self, name: &str, level: Sensitivity) -> Self
pub fn override_header(self, name: &str, level: Sensitivity) -> Self
Sourcepub fn allow_header_exact(self, name: &str) -> Self
pub fn allow_header_exact(self, name: &str) -> Self
Sourcepub fn allow_header_suffix(self, name: &str) -> Self
pub fn allow_header_suffix(self, name: &str) -> Self
Sourcepub fn remove_header_allow_exact(self, name: &str) -> Self
pub fn remove_header_allow_exact(self, name: &str) -> Self
Sourcepub fn remove_header_allow_suffix(self, name: &str) -> Self
pub fn remove_header_allow_suffix(self, name: &str) -> Self
Sourcepub fn clear_header_allow_rules(self) -> Self
pub fn clear_header_allow_rules(self) -> Self
Sourcepub fn raise_query(self, name: &str, level: Sensitivity) -> Self
pub fn raise_query(self, name: &str, level: Sensitivity) -> Self
Sourcepub fn override_query(self, name: &str, level: Sensitivity) -> Self
pub fn override_query(self, name: &str, level: Sensitivity) -> Self
Sourcepub fn allow_query_exact(self, name: &str) -> Self
pub fn allow_query_exact(self, name: &str) -> Self
Sourcepub fn allow_query_suffix(self, name: &str) -> Self
pub fn allow_query_suffix(self, name: &str) -> Self
Sourcepub fn remove_query_allow_exact(self, name: &str) -> Self
pub fn remove_query_allow_exact(self, name: &str) -> Self
Sourcepub fn remove_query_allow_suffix(self, name: &str) -> Self
pub fn remove_query_allow_suffix(self, name: &str) -> Self
Sourcepub fn clear_query_allow_rules(self) -> Self
pub fn clear_query_allow_rules(self) -> Self
Sourcepub fn raise_body(self, name: &str, level: Sensitivity) -> Self
pub fn raise_body(self, name: &str, level: Sensitivity) -> Self
Sourcepub fn override_body(self, name: &str, level: Sensitivity) -> Self
pub fn override_body(self, name: &str, level: Sensitivity) -> Self
Sourcepub fn allow_body_exact(self, name: &str) -> Self
pub fn allow_body_exact(self, name: &str) -> Self
Sourcepub fn allow_body_suffix(self, name: &str) -> Self
pub fn allow_body_suffix(self, name: &str) -> Self
Sourcepub fn remove_body_allow_exact(self, name: &str) -> Self
pub fn remove_body_allow_exact(self, name: &str) -> Self
Sourcepub fn remove_body_allow_suffix(self, name: &str) -> Self
pub fn remove_body_allow_suffix(self, name: &str) -> Self
Sourcepub fn clear_body_allow_rules(self) -> Self
pub fn clear_body_allow_rules(self) -> Self
Sourcepub const fn url_path_policy(self, policy: UrlPathPolicy) -> Self
pub const fn url_path_policy(self, policy: UrlPathPolicy) -> Self
Sourcepub const fn text_body_policy(self, policy: TextBodyPolicy) -> Self
pub const fn text_body_policy(self, policy: TextBodyPolicy) -> Self
Sourcepub const fn unkeyed_json_value_policy(
self,
policy: UnkeyedJsonValuePolicy,
) -> Self
pub const fn unkeyed_json_value_policy( self, policy: UnkeyedJsonValuePolicy, ) -> Self
Sourcepub const fn body_budget(self, budget: BodyBudget) -> Self
pub const fn body_budget(self, budget: BodyBudget) -> Self
Sourcepub fn diagnostic_budget(self, budget: DiagnosticBudget) -> Self
pub fn diagnostic_budget(self, budget: DiagnosticBudget) -> Self
Sourcepub fn build(self) -> Result<HttpRedactionPolicy, PolicyError>
pub fn build(self) -> Result<HttpRedactionPolicy, PolicyError>
Validates all field rules and builds the complete HTTP policy.
§Returns
A complete immutable HTTP policy snapshot.
§Errors
Returns the first PolicyError found while validating the header,
query, and body policy builders in that order.
Trait Implementations§
Source§impl Clone for HttpRedactionPolicyBuilder
impl Clone for HttpRedactionPolicyBuilder
Source§fn clone(&self) -> HttpRedactionPolicyBuilder
fn clone(&self) -> HttpRedactionPolicyBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HttpRedactionPolicyBuilder
impl Debug for HttpRedactionPolicyBuilder
Auto Trait Implementations§
impl Freeze for HttpRedactionPolicyBuilder
impl RefUnwindSafe for HttpRedactionPolicyBuilder
impl Send for HttpRedactionPolicyBuilder
impl Sync for HttpRedactionPolicyBuilder
impl Unpin for HttpRedactionPolicyBuilder
impl UnsafeUnpin for HttpRedactionPolicyBuilder
impl UnwindSafe for HttpRedactionPolicyBuilder
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