pub struct FieldMaskingRule { /* private fields */ }Expand description
字段级脱敏规则:字段名 + 脱敏规则 + 可选条件 + 优先级。
优先级数值越小越先应用(默认 100)。当多个规则匹配同一字段时, 仅应用优先级最高(数值最小)的规则。
Implementations§
Source§impl FieldMaskingRule
impl FieldMaskingRule
Sourcepub fn new(field: &str, rule: MaskingRule) -> Self
pub fn new(field: &str, rule: MaskingRule) -> Self
创建无条件字段规则(默认优先级 100)
Sourcepub fn with_condition(self, cond: MaskingCondition) -> Self
pub fn with_condition(self, cond: MaskingCondition) -> Self
设置脱敏条件(链式)
Sourcepub fn with_priority(self, priority: u32) -> Self
pub fn with_priority(self, priority: u32) -> Self
设置优先级(链式)
Sourcepub fn rule(&self) -> &MaskingRule
pub fn rule(&self) -> &MaskingRule
脱敏规则
Sourcepub fn condition(&self) -> Option<&MaskingCondition>
pub fn condition(&self) -> Option<&MaskingCondition>
脱敏条件
Trait Implementations§
Source§impl Clone for FieldMaskingRule
impl Clone for FieldMaskingRule
Source§fn clone(&self) -> FieldMaskingRule
fn clone(&self) -> FieldMaskingRule
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 FieldMaskingRule
impl Debug for FieldMaskingRule
Source§impl<'de> Deserialize<'de> for FieldMaskingRule
impl<'de> Deserialize<'de> for FieldMaskingRule
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for FieldMaskingRule
impl RefUnwindSafe for FieldMaskingRule
impl Send for FieldMaskingRule
impl Sync for FieldMaskingRule
impl Unpin for FieldMaskingRule
impl UnsafeUnpin for FieldMaskingRule
impl UnwindSafe for FieldMaskingRule
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