#[non_exhaustive]pub enum PredefinedExpression {
Unspecified,
Sha256,
AlwaysNull,
DefaultMaskingValue,
LastFourCharacters,
FirstFourCharacters,
EmailMask,
DateYearMask,
UnknownValue(UnknownValue),
}Expand description
The available masking rules. Learn more here: https://cloud.google.com/bigquery/docs/column-data-masking-intro#masking_options.
§Working with unknown values
This enum is defined as #[non_exhaustive] because Google Cloud may add
additional enum variants at any time. Adding new variants is not considered
a breaking change. Applications should write their code in anticipation of:
- New values appearing in future releases of the client library, and
- New values received dynamically, without application changes.
Please consult the Working with enums section in the user guide for some guidelines.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Unspecified
Default, unspecified predefined expression. No masking will take place since no expression is specified.
Sha256
Masking expression to replace data with SHA-256 hash.
AlwaysNull
Masking expression to replace data with NULLs.
DefaultMaskingValue
Masking expression to replace data with their default masking values. The default masking values for each type listed as below:
- STRING: “”
- BYTES: b’’
- INTEGER: 0
- FLOAT: 0.0
- NUMERIC: 0
- BOOLEAN: FALSE
- TIMESTAMP: 1970-01-01 00:00:00 UTC
- DATE: 1970-01-01
- TIME: 00:00:00
- DATETIME: 1970-01-01T00:00:00
- GEOGRAPHY: POINT(0 0)
- BIGNUMERIC: 0
- ARRAY: []
- STRUCT: NOT_APPLICABLE
- JSON: NULL
LastFourCharacters
Masking expression shows the last four characters of text. The masking behavior is as follows:
- If text length > 4 characters: Replace text with XXXXX, append last four characters of original text.
- If text length <= 4 characters: Apply SHA-256 hash.
FirstFourCharacters
Masking expression shows the first four characters of text. The masking behavior is as follows:
- If text length > 4 characters: Replace text with XXXXX, prepend first four characters of original text.
- If text length <= 4 characters: Apply SHA-256 hash.
EmailMask
Masking expression for email addresses. The masking behavior is as follows:
- Syntax-valid email address: Replace username with XXXXX. For example, cloudysanfrancisco@gmail.com becomes XXXXX@gmail.com.
- Syntax-invalid email address: Apply SHA-256 hash.
For more information, see Email mask.
DateYearMask
Masking expression to only show the year of Date,
DateTime and TimeStamp. For example, with the
year 2076:
- DATE : 2076-01-01
- DATETIME : 2076-01-01T00:00:00
- TIMESTAMP : 2076-01-01 00:00:00 UTC
Truncation occurs according to the UTC time zone. To change this, adjust
the default time zone using the time_zone system variable.
For more information, see the System
variables reference.
UnknownValue(UnknownValue)
If set, the enum was initialized with an unknown value.
Applications can examine the value using PredefinedExpression::value or PredefinedExpression::name.
Implementations§
Trait Implementations§
Source§impl Clone for PredefinedExpression
impl Clone for PredefinedExpression
Source§fn clone(&self) -> PredefinedExpression
fn clone(&self) -> PredefinedExpression
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PredefinedExpression
impl Debug for PredefinedExpression
Source§impl Default for PredefinedExpression
impl Default for PredefinedExpression
Source§impl<'de> Deserialize<'de> for PredefinedExpression
impl<'de> Deserialize<'de> for PredefinedExpression
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>,
Source§impl Display for PredefinedExpression
impl Display for PredefinedExpression
Source§impl From<&str> for PredefinedExpression
impl From<&str> for PredefinedExpression
Source§impl From<i32> for PredefinedExpression
impl From<i32> for PredefinedExpression
Source§impl PartialEq for PredefinedExpression
impl PartialEq for PredefinedExpression
Source§impl Serialize for PredefinedExpression
impl Serialize for PredefinedExpression
impl StructuralPartialEq for PredefinedExpression
Auto Trait Implementations§
impl Freeze for PredefinedExpression
impl RefUnwindSafe for PredefinedExpression
impl Send for PredefinedExpression
impl Sync for PredefinedExpression
impl Unpin for PredefinedExpression
impl UnwindSafe for PredefinedExpression
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.