#[non_exhaustive]pub struct Rule {
pub description: String,
pub rule_action_types: Vec<RuleActionType>,
pub implementation: Option<Implementation>,
/* private fields */
}Expand description
A rule in the cloud control.
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.description: StringOptional. The rule description. The maximum length is 2000 characters.
rule_action_types: Vec<RuleActionType>Required. The functionality that’s enabled by the rule.
implementation: Option<Implementation>The rule implementation.
Implementations§
Source§impl Rule
impl Rule
pub fn new() -> Self
Sourcepub fn set_description<T: Into<String>>(self, v: T) -> Self
pub fn set_description<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_rule_action_types<T, V>(self, v: T) -> Self
pub fn set_rule_action_types<T, V>(self, v: T) -> Self
Sets the value of rule_action_types.
§Example
ⓘ
use google_cloud_cloudsecuritycompliance_v1::model::RuleActionType;
let x = Rule::new().set_rule_action_types([
RuleActionType::Preventive,
RuleActionType::Detective,
RuleActionType::Audit,
]);Sourcepub fn set_implementation<T: Into<Option<Implementation>>>(self, v: T) -> Self
pub fn set_implementation<T: Into<Option<Implementation>>>(self, v: T) -> Self
Sets the value of implementation.
Note that all the setters affecting implementation are mutually
exclusive.
§Example
ⓘ
use google_cloud_cloudsecuritycompliance_v1::model::CELExpression;
let x = Rule::new().set_implementation(Some(
google_cloud_cloudsecuritycompliance_v1::model::rule::Implementation::CelExpression(CELExpression::default().into())));Sourcepub fn cel_expression(&self) -> Option<&Box<CELExpression>>
pub fn cel_expression(&self) -> Option<&Box<CELExpression>>
The value of implementation
if it holds a CelExpression, None if the field is not set or
holds a different branch.
Sourcepub fn set_cel_expression<T: Into<Box<CELExpression>>>(self, v: T) -> Self
pub fn set_cel_expression<T: Into<Box<CELExpression>>>(self, v: T) -> Self
Sets the value of implementation
to hold a CelExpression.
Note that all the setters affecting implementation are
mutually exclusive.
§Example
ⓘ
use google_cloud_cloudsecuritycompliance_v1::model::CELExpression;
let x = Rule::new().set_cel_expression(CELExpression::default()/* use setters */);
assert!(x.cel_expression().is_some());Trait Implementations§
impl StructuralPartialEq for Rule
Auto Trait Implementations§
impl Freeze for Rule
impl RefUnwindSafe for Rule
impl Send for Rule
impl Sync for Rule
impl Unpin for Rule
impl UnwindSafe for Rule
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