pub enum MaskAction {
Redact {
mask: Value,
},
Hash,
Tokenize {
prefix: Option<String>,
},
Partial {
keep_last: usize,
mask_char: Option<char>,
},
}Available on crate feature
masking only.Expand description
What to do with a value once a rule matches it.
Variants§
Redact
Replace the value wholesale with a fixed mask (default "***").
Irreversible and not joinable — use for values you never need again.
Fields
Hash
Replace the value with its hex HMAC-SHA256 (keyed) / SHA-256 (unkeyed) digest. Deterministic → joinable; irreversible.
Tokenize
Replace the value with a short opaque token derived from a keyed digest,
optionally with a stable prefix (e.g. tok_). Deterministic → joinable.
Partial
Reveal only the last keep_last characters, replacing the rest with
mask_char (default *). Preserves format/length for readability
(e.g. ****1234). keep_last: 0 masks everything.
Implementations§
Trait Implementations§
Source§impl Clone for MaskAction
impl Clone for MaskAction
Source§fn clone(&self) -> MaskAction
fn clone(&self) -> MaskAction
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 MaskAction
impl Debug for MaskAction
Source§impl<'de> Deserialize<'de> for MaskAction
impl<'de> Deserialize<'de> for MaskAction
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
Source§impl JsonSchema for MaskAction
impl JsonSchema for MaskAction
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for MaskAction
impl RefUnwindSafe for MaskAction
impl Send for MaskAction
impl Sync for MaskAction
impl Unpin for MaskAction
impl UnsafeUnpin for MaskAction
impl UnwindSafe for MaskAction
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request