pub struct MaskingConfigManager { /* private fields */ }Expand description
脱敏配置管理器:管理多套脱敏档案,按名称切换。
支持默认档案、按名称获取档案、合并档案等操作。
Implementations§
Source§impl MaskingConfigManager
impl MaskingConfigManager
Sourcepub fn add_profile(self, profile: MaskingProfile) -> Self
pub fn add_profile(self, profile: MaskingProfile) -> Self
注册档案(链式)
Sourcepub fn set_default(&mut self, name: &str) -> bool
pub fn set_default(&mut self, name: &str) -> bool
设置默认档案名
Sourcepub fn default_profile_name(&self) -> &str
pub fn default_profile_name(&self) -> &str
默认档案名
Sourcepub fn get_profile(&self, name: &str) -> Option<&MaskingProfile>
pub fn get_profile(&self, name: &str) -> Option<&MaskingProfile>
获取档案
Sourcepub fn default_profile(&self) -> Option<&MaskingProfile>
pub fn default_profile(&self) -> Option<&MaskingProfile>
获取默认档案
Sourcepub fn profile_count(&self) -> usize
pub fn profile_count(&self) -> usize
档案数
Sourcepub fn profile_names(&self) -> Vec<&str>
pub fn profile_names(&self) -> Vec<&str>
所有档案名
Sourcepub fn remove_profile(&mut self, name: &str) -> Option<MaskingProfile>
pub fn remove_profile(&mut self, name: &str) -> Option<MaskingProfile>
移除档案
Sourcepub fn apply_to_map(
&self,
profile_name: &str,
data: &HashMap<String, String>,
) -> Option<HashMap<String, String>>
pub fn apply_to_map( &self, profile_name: &str, data: &HashMap<String, String>, ) -> Option<HashMap<String, String>>
用指定档案脱敏 HashMap
Sourcepub fn apply_with_default(
&self,
data: &HashMap<String, String>,
) -> Option<HashMap<String, String>>
pub fn apply_with_default( &self, data: &HashMap<String, String>, ) -> Option<HashMap<String, String>>
用默认档案脱敏 HashMap
Sourcepub fn merge_profiles(
&self,
target: &str,
source: &str,
) -> Option<MaskingProfile>
pub fn merge_profiles( &self, target: &str, source: &str, ) -> Option<MaskingProfile>
合并两个档案:将 source 的规则补充到 target(不覆盖已有规则)
Trait Implementations§
Source§impl Clone for MaskingConfigManager
impl Clone for MaskingConfigManager
Source§fn clone(&self) -> MaskingConfigManager
fn clone(&self) -> MaskingConfigManager
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 MaskingConfigManager
impl Debug for MaskingConfigManager
Source§impl Default for MaskingConfigManager
impl Default for MaskingConfigManager
Source§fn default() -> MaskingConfigManager
fn default() -> MaskingConfigManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MaskingConfigManager
impl RefUnwindSafe for MaskingConfigManager
impl Send for MaskingConfigManager
impl Sync for MaskingConfigManager
impl Unpin for MaskingConfigManager
impl UnsafeUnpin for MaskingConfigManager
impl UnwindSafe for MaskingConfigManager
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