pub struct RedactionRule {
pub pattern: Option<String>,
pub match_mode: Option<i32>,
pub keep_full: Option<bool>,
pub replacement_name: Option<String>,
pub keep_file_extension: Option<bool>,
pub keep_path_elements: Option<u32>,
}Fields§
§pattern: Option<String>The pattern to match against.
match_mode: Option<i32>§keep_full: Option<bool>If the pattern matches, keep the entire name. In other words, do not redact. This option exists since the rules are evaluated in order, so a more specific allow rule with keep_full can match before a more general deny rule. This option is mutually exclusive with |keep_file_extension| and |keep_path_elements|.
replacement_name: Option<String>If the pattern matches, replace the name with this string (defaulting to <pf_redacted> if unset). The final emitted name might be further augmented by the options below keeping parts of the original name.
keep_file_extension: Option<bool>If the pattern matches, keep the file extension, if any. Can be combined with |keep_path_elements|.
keep_path_elements: Option<u32>If the pattern matches, keep the first N path elements (as separated by ‘/’). If the name is not a path, this option does nothing. Can be combined with |keep_file_extension|.
Implementations§
Source§impl RedactionRule
impl RedactionRule
Sourcepub fn pattern(&self) -> &str
pub fn pattern(&self) -> &str
Returns the value of pattern, or the default value if pattern is unset.
Sourcepub fn match_mode(&self) -> MatchMode
pub fn match_mode(&self) -> MatchMode
Returns the enum value of match_mode, or the default if the field is unset or set to an invalid enum value.
Sourcepub fn set_match_mode(&mut self, value: MatchMode)
pub fn set_match_mode(&mut self, value: MatchMode)
Sets match_mode to the provided enum value.
Sourcepub fn keep_full(&self) -> bool
pub fn keep_full(&self) -> bool
Returns the value of keep_full, or the default value if keep_full is unset.
Sourcepub fn replacement_name(&self) -> &str
pub fn replacement_name(&self) -> &str
Returns the value of replacement_name, or the default value if replacement_name is unset.
Sourcepub fn keep_file_extension(&self) -> bool
pub fn keep_file_extension(&self) -> bool
Returns the value of keep_file_extension, or the default value if keep_file_extension is unset.
Sourcepub fn keep_path_elements(&self) -> u32
pub fn keep_path_elements(&self) -> u32
Returns the value of keep_path_elements, or the default value if keep_path_elements is unset.
Trait Implementations§
Source§impl Clone for RedactionRule
impl Clone for RedactionRule
Source§fn clone(&self) -> RedactionRule
fn clone(&self) -> RedactionRule
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RedactionRule
impl Debug for RedactionRule
Source§impl Default for RedactionRule
impl Default for RedactionRule
Source§impl Hash for RedactionRule
impl Hash for RedactionRule
Source§impl Message for RedactionRule
impl Message for RedactionRule
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl PartialEq for RedactionRule
impl PartialEq for RedactionRule
Source§fn eq(&self, other: &RedactionRule) -> bool
fn eq(&self, other: &RedactionRule) -> bool
self and other values to be equal, and is used by ==.