pub struct RedactionFloorBuilder { /* private fields */ }Expand description
Builder for a RedactionFloor.
§Examples
use qubit_redact::RedactionFloor;
use qubit_redact::Sensitivity;
let floor = RedactionFloor::builder().raise("pin", Sensitivity::Secret)?.build()?;
assert!(floor.sensitive_rules().any(|rule| rule.field() == "pin"));Implementations§
Source§impl RedactionFloorBuilder
impl RedactionFloorBuilder
Sourcepub fn matching(self, matching: FieldNameMatching) -> Self
pub fn matching(self, matching: FieldNameMatching) -> Self
Sets field-name matching behavior.
Sourcepub fn unknown_field_policy(self, policy: UnknownFieldPolicy) -> Self
pub fn unknown_field_policy(self, policy: UnknownFieldPolicy) -> Self
Sets the fallback for fields without an explicit floor rule.
Sourcepub fn include_preset(self, preset: SensitiveFieldPreset) -> Self
pub fn include_preset(self, preset: SensitiveFieldPreset) -> Self
Adds every sensitive field in one preset.
Sourcepub fn raise(self, field: &str, level: Sensitivity) -> Result<Self, PolicyError>
pub fn raise(self, field: &str, level: Sensitivity) -> Result<Self, PolicyError>
Raises field to at least level.
§Errors
Returns PolicyError::EmptyFieldName when field has no canonical
floor-rule name.
Sourcepub fn build(self) -> Result<RedactionFloor, PolicyError>
pub fn build(self) -> Result<RedactionFloor, PolicyError>
Validates and constructs the immutable floor.
§Errors
Currently infallible because field names are validated when added. The result retains the policy construction error type.
Trait Implementations§
Source§impl Clone for RedactionFloorBuilder
impl Clone for RedactionFloorBuilder
Source§fn clone(&self) -> RedactionFloorBuilder
fn clone(&self) -> RedactionFloorBuilder
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 moreAuto Trait Implementations§
impl Freeze for RedactionFloorBuilder
impl RefUnwindSafe for RedactionFloorBuilder
impl Send for RedactionFloorBuilder
impl Sync for RedactionFloorBuilder
impl Unpin for RedactionFloorBuilder
impl UnsafeUnpin for RedactionFloorBuilder
impl UnwindSafe for RedactionFloorBuilder
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