pub enum MaskPolicy {
Fixed {
replacement: String,
},
PreserveEdges {
prefix_chars: usize,
suffix_chars: usize,
replacement: String,
full_mask_below_or_equal: usize,
},
PreserveSuffix {
suffix_chars: usize,
replacement: String,
full_mask_below_or_equal: usize,
},
Empty,
}Expand description
Strategy used to mask one sensitive field value.
Variants§
Fixed
Replaces non-empty values with a fixed replacement string.
PreserveEdges
Preserves a prefix and suffix for diagnosability.
Fields
PreserveSuffix
Preserves only the final part of the value.
Fields
Empty
Removes non-empty values entirely.
Implementations§
Source§impl MaskPolicy
impl MaskPolicy
Sourcepub fn preserve_edges(
prefix_chars: usize,
suffix_chars: usize,
replacement: &str,
full_mask_below_or_equal: usize,
) -> Self
pub fn preserve_edges( prefix_chars: usize, suffix_chars: usize, replacement: &str, full_mask_below_or_equal: usize, ) -> Self
Creates an edge-preserving mask policy.
§Parameters
prefix_chars- Number of leading characters to retain.suffix_chars- Number of trailing characters to retain.replacement- Replacement inserted between retained edges.full_mask_below_or_equal- Character length threshold for full masks.
§Returns
A mask policy that keeps selected value edges for long values.
Sourcepub fn preserve_suffix(
suffix_chars: usize,
replacement: &str,
full_mask_below_or_equal: usize,
) -> Self
pub fn preserve_suffix( suffix_chars: usize, replacement: &str, full_mask_below_or_equal: usize, ) -> Self
Creates a suffix-preserving mask policy.
§Parameters
suffix_chars- Number of trailing characters to retain.replacement- Replacement inserted before the suffix.full_mask_below_or_equal- Character length threshold for full masks.
§Returns
A mask policy that keeps only the selected trailing characters.
Sourcepub const fn empty() -> Self
pub const fn empty() -> Self
Creates a policy that removes non-empty values.
§Returns
A mask policy that returns an empty value for every non-empty input.
Trait Implementations§
Source§impl Clone for MaskPolicy
impl Clone for MaskPolicy
Source§fn clone(&self) -> MaskPolicy
fn clone(&self) -> MaskPolicy
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 MaskPolicy
impl Debug for MaskPolicy
Source§impl PartialEq for MaskPolicy
impl PartialEq for MaskPolicy
Source§fn eq(&self, other: &MaskPolicy) -> bool
fn eq(&self, other: &MaskPolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for MaskPolicy
impl StructuralPartialEq for MaskPolicy
Auto Trait Implementations§
impl Freeze for MaskPolicy
impl RefUnwindSafe for MaskPolicy
impl Send for MaskPolicy
impl Sync for MaskPolicy
impl Unpin for MaskPolicy
impl UnsafeUnpin for MaskPolicy
impl UnwindSafe for MaskPolicy
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