pub struct MaskingPolicy { /* private fields */ }Expand description
Masking strategy: define masking rules for multiple fields, applied in batch
Implementations§
Source§impl MaskingPolicy
impl MaskingPolicy
Sourcepub fn add_rule(&mut self, field: &str, rule: MaskingRule) -> &mut Self
pub fn add_rule(&mut self, field: &str, rule: MaskingRule) -> &mut Self
Add field masking rule (chainable)
Sourcepub fn get_rule(&self, field: &str) -> Option<&MaskingRule>
pub fn get_rule(&self, field: &str) -> Option<&MaskingRule>
Get masking rule for a field
Sourcepub fn remove_rule(&mut self, field: &str) -> Option<MaskingRule>
pub fn remove_rule(&mut self, field: &str) -> Option<MaskingRule>
Remove masking rule for a field
Sourcepub fn field_count(&self) -> usize
pub fn field_count(&self) -> usize
Number of registered fields
Sourcepub fn rules(&self) -> &HashMap<String, MaskingRule>
pub fn rules(&self) -> &HashMap<String, MaskingRule>
Get all rule references
Sourcepub fn apply_to_map(
&self,
data: &HashMap<String, String>,
) -> HashMap<String, String>
pub fn apply_to_map( &self, data: &HashMap<String, String>, ) -> HashMap<String, String>
Apply masking to HashMap data
Sourcepub fn apply_to_json(&self, json: &str) -> String
pub fn apply_to_json(&self, json: &str) -> String
Apply masking to JSON string
Trait Implementations§
Source§impl Clone for MaskingPolicy
impl Clone for MaskingPolicy
Source§fn clone(&self) -> MaskingPolicy
fn clone(&self) -> MaskingPolicy
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 MaskingPolicy
impl Debug for MaskingPolicy
Source§impl Default for MaskingPolicy
impl Default for MaskingPolicy
Source§fn default() -> MaskingPolicy
fn default() -> MaskingPolicy
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MaskingPolicy
impl RefUnwindSafe for MaskingPolicy
impl Send for MaskingPolicy
impl Sync for MaskingPolicy
impl Unpin for MaskingPolicy
impl UnsafeUnpin for MaskingPolicy
impl UnwindSafe for MaskingPolicy
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