#[non_exhaustive]pub struct ValueMatcher {
pub match_variant: Option<MatchVariant>,
/* private fields */
}Expand description
Contains various matching options for values for a GCP resource field.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.match_variant: Option<MatchVariant>Implementations§
Source§impl ValueMatcher
impl ValueMatcher
Sourcepub fn set_match_variant<T: Into<Option<MatchVariant>>>(self, v: T) -> Self
pub fn set_match_variant<T: Into<Option<MatchVariant>>>(self, v: T) -> Self
Sets the value of match_variant.
Note that all the setters affecting match_variant are mutually
exclusive.
§Example
ⓘ
use google_cloud_recommender_v1::model::value_matcher::MatchVariant;
let x = ValueMatcher::new().set_match_variant(Some(MatchVariant::MatchesPattern("example".to_string())));Sourcepub fn matches_pattern(&self) -> Option<&String>
pub fn matches_pattern(&self) -> Option<&String>
The value of match_variant
if it holds a MatchesPattern, None if the field is not set or
holds a different branch.
Sourcepub fn set_matches_pattern<T: Into<String>>(self, v: T) -> Self
pub fn set_matches_pattern<T: Into<String>>(self, v: T) -> Self
Sets the value of match_variant
to hold a MatchesPattern.
Note that all the setters affecting match_variant are
mutually exclusive.
§Example
ⓘ
let x = ValueMatcher::new().set_matches_pattern("example");
assert!(x.matches_pattern().is_some());Trait Implementations§
Source§impl Clone for ValueMatcher
impl Clone for ValueMatcher
Source§fn clone(&self) -> ValueMatcher
fn clone(&self) -> ValueMatcher
Returns a duplicate of the value. Read more
1.0.0 · 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 ValueMatcher
impl Debug for ValueMatcher
Source§impl Default for ValueMatcher
impl Default for ValueMatcher
Source§fn default() -> ValueMatcher
fn default() -> ValueMatcher
Returns the “default value” for a type. Read more
Source§impl Message for ValueMatcher
impl Message for ValueMatcher
Source§impl PartialEq for ValueMatcher
impl PartialEq for ValueMatcher
impl StructuralPartialEq for ValueMatcher
Auto Trait Implementations§
impl Freeze for ValueMatcher
impl RefUnwindSafe for ValueMatcher
impl Send for ValueMatcher
impl Sync for ValueMatcher
impl Unpin for ValueMatcher
impl UnsafeUnpin for ValueMatcher
impl UnwindSafe for ValueMatcher
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