#[non_exhaustive]pub struct StringMatch {
pub ignore_case: bool,
pub match_pattern: Option<MatchPattern>,
/* private fields */
}Expand description
Determines how a string value should be matched.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.ignore_case: boolIf true, indicates the exact/prefix/suffix/contains matching should be
case insensitive. For example, the matcher data will match both
input string Data and data if set to true.
match_pattern: Option<MatchPattern>Implementations§
Source§impl StringMatch
impl StringMatch
Sourcepub fn set_ignore_case<T: Into<bool>>(self, v: T) -> Self
pub fn set_ignore_case<T: Into<bool>>(self, v: T) -> Self
Sourcepub fn set_match_pattern<T: Into<Option<MatchPattern>>>(self, v: T) -> Self
pub fn set_match_pattern<T: Into<Option<MatchPattern>>>(self, v: T) -> Self
Sets the value of match_pattern.
Note that all the setters affecting match_pattern are mutually
exclusive.
§Example
use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::string_match::MatchPattern;
let x = StringMatch::new().set_match_pattern(Some(MatchPattern::Exact("example".to_string())));Sourcepub fn exact(&self) -> Option<&String>
pub fn exact(&self) -> Option<&String>
The value of match_pattern
if it holds a Exact, None if the field is not set or
holds a different branch.
Sourcepub fn set_exact<T: Into<String>>(self, v: T) -> Self
pub fn set_exact<T: Into<String>>(self, v: T) -> Self
Sets the value of match_pattern
to hold a Exact.
Note that all the setters affecting match_pattern are
mutually exclusive.
§Example
let x = StringMatch::new().set_exact("example");
assert!(x.exact().is_some());
assert!(x.prefix().is_none());
assert!(x.suffix().is_none());
assert!(x.contains().is_none());Sourcepub fn prefix(&self) -> Option<&String>
pub fn prefix(&self) -> Option<&String>
The value of match_pattern
if it holds a Prefix, None if the field is not set or
holds a different branch.
Sourcepub fn set_prefix<T: Into<String>>(self, v: T) -> Self
pub fn set_prefix<T: Into<String>>(self, v: T) -> Self
Sets the value of match_pattern
to hold a Prefix.
Note that all the setters affecting match_pattern are
mutually exclusive.
§Example
let x = StringMatch::new().set_prefix("example");
assert!(x.prefix().is_some());
assert!(x.exact().is_none());
assert!(x.suffix().is_none());
assert!(x.contains().is_none());Sourcepub fn suffix(&self) -> Option<&String>
pub fn suffix(&self) -> Option<&String>
The value of match_pattern
if it holds a Suffix, None if the field is not set or
holds a different branch.
Sourcepub fn set_suffix<T: Into<String>>(self, v: T) -> Self
pub fn set_suffix<T: Into<String>>(self, v: T) -> Self
Sets the value of match_pattern
to hold a Suffix.
Note that all the setters affecting match_pattern are
mutually exclusive.
§Example
let x = StringMatch::new().set_suffix("example");
assert!(x.suffix().is_some());
assert!(x.exact().is_none());
assert!(x.prefix().is_none());
assert!(x.contains().is_none());Sourcepub fn contains(&self) -> Option<&String>
pub fn contains(&self) -> Option<&String>
The value of match_pattern
if it holds a Contains, None if the field is not set or
holds a different branch.
Sourcepub fn set_contains<T: Into<String>>(self, v: T) -> Self
pub fn set_contains<T: Into<String>>(self, v: T) -> Self
Sets the value of match_pattern
to hold a Contains.
Note that all the setters affecting match_pattern are
mutually exclusive.
§Example
let x = StringMatch::new().set_contains("example");
assert!(x.contains().is_some());
assert!(x.exact().is_none());
assert!(x.prefix().is_none());
assert!(x.suffix().is_none());Trait Implementations§
Source§impl Clone for StringMatch
impl Clone for StringMatch
Source§fn clone(&self) -> StringMatch
fn clone(&self) -> StringMatch
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more