#[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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StringMatch
impl Debug for StringMatch
Source§impl Default for StringMatch
impl Default for StringMatch
Source§fn default() -> StringMatch
fn default() -> StringMatch
Source§impl Message for StringMatch
impl Message for StringMatch
Source§impl PartialEq for StringMatch
impl PartialEq for StringMatch
impl StructuralPartialEq for StringMatch
Auto Trait Implementations§
impl Freeze for StringMatch
impl RefUnwindSafe for StringMatch
impl Send for StringMatch
impl Sync for StringMatch
impl Unpin for StringMatch
impl UnsafeUnpin for StringMatch
impl UnwindSafe for StringMatch
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
T in a tonic::Request