#[non_exhaustive]pub struct Validation {
pub constraint: Option<Constraint>,
/* private fields */
}Expand description
The validation of the parameter.
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.constraint: Option<Constraint>Defines validators for parameter values.
Implementations§
Source§impl Validation
impl Validation
Sourcepub fn set_constraint<T: Into<Option<Constraint>>>(self, v: T) -> Self
pub fn set_constraint<T: Into<Option<Constraint>>>(self, v: T) -> Self
Sets the value of constraint.
Note that all the setters affecting constraint are mutually
exclusive.
§Example
use google_cloud_cloudsecuritycompliance_v1::model::AllowedValues;
let x = Validation::new().set_constraint(Some(
google_cloud_cloudsecuritycompliance_v1::model::validation::Constraint::AllowedValues(AllowedValues::default().into())));Sourcepub fn allowed_values(&self) -> Option<&Box<AllowedValues>>
pub fn allowed_values(&self) -> Option<&Box<AllowedValues>>
The value of constraint
if it holds a AllowedValues, None if the field is not set or
holds a different branch.
Sourcepub fn set_allowed_values<T: Into<Box<AllowedValues>>>(self, v: T) -> Self
pub fn set_allowed_values<T: Into<Box<AllowedValues>>>(self, v: T) -> Self
Sets the value of constraint
to hold a AllowedValues.
Note that all the setters affecting constraint are
mutually exclusive.
§Example
use google_cloud_cloudsecuritycompliance_v1::model::AllowedValues;
let x = Validation::new().set_allowed_values(AllowedValues::default()/* use setters */);
assert!(x.allowed_values().is_some());
assert!(x.int_range().is_none());
assert!(x.regexp_pattern().is_none());Sourcepub fn int_range(&self) -> Option<&Box<IntRange>>
pub fn int_range(&self) -> Option<&Box<IntRange>>
The value of constraint
if it holds a IntRange, None if the field is not set or
holds a different branch.
Sourcepub fn set_int_range<T: Into<Box<IntRange>>>(self, v: T) -> Self
pub fn set_int_range<T: Into<Box<IntRange>>>(self, v: T) -> Self
Sets the value of constraint
to hold a IntRange.
Note that all the setters affecting constraint are
mutually exclusive.
§Example
use google_cloud_cloudsecuritycompliance_v1::model::IntRange;
let x = Validation::new().set_int_range(IntRange::default()/* use setters */);
assert!(x.int_range().is_some());
assert!(x.allowed_values().is_none());
assert!(x.regexp_pattern().is_none());Sourcepub fn regexp_pattern(&self) -> Option<&Box<RegexpPattern>>
pub fn regexp_pattern(&self) -> Option<&Box<RegexpPattern>>
The value of constraint
if it holds a RegexpPattern, None if the field is not set or
holds a different branch.
Sourcepub fn set_regexp_pattern<T: Into<Box<RegexpPattern>>>(self, v: T) -> Self
pub fn set_regexp_pattern<T: Into<Box<RegexpPattern>>>(self, v: T) -> Self
Sets the value of constraint
to hold a RegexpPattern.
Note that all the setters affecting constraint are
mutually exclusive.
§Example
use google_cloud_cloudsecuritycompliance_v1::model::RegexpPattern;
let x = Validation::new().set_regexp_pattern(RegexpPattern::default()/* use setters */);
assert!(x.regexp_pattern().is_some());
assert!(x.allowed_values().is_none());
assert!(x.int_range().is_none());Trait Implementations§
Source§impl Clone for Validation
impl Clone for Validation
Source§fn clone(&self) -> Validation
fn clone(&self) -> Validation
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 Validation
impl Debug for Validation
Source§impl Default for Validation
impl Default for Validation
Source§fn default() -> Validation
fn default() -> Validation
Source§impl PartialEq for Validation
impl PartialEq for Validation
impl StructuralPartialEq for Validation
Auto Trait Implementations§
impl Freeze for Validation
impl RefUnwindSafe for Validation
impl Send for Validation
impl Sync for Validation
impl Unpin for Validation
impl UnsafeUnpin for Validation
impl UnwindSafe for Validation
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