#[non_exhaustive]pub struct ParamValue {
pub kind: Option<Kind>,
/* private fields */
}Expand description
The possible parameter value types.
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.kind: Option<Kind>The list of possible parameter value types.
Implementations§
Source§impl ParamValue
impl ParamValue
Sourcepub fn string_value(&self) -> Option<&String>
pub fn string_value(&self) -> Option<&String>
The value of kind
if it holds a StringValue, None if the field is not set or
holds a different branch.
Sourcepub fn set_string_value<T: Into<String>>(self, v: T) -> Self
pub fn set_string_value<T: Into<String>>(self, v: T) -> Self
Sets the value of kind
to hold a StringValue.
Note that all the setters affecting kind are
mutually exclusive.
§Example
let x = ParamValue::new().set_string_value("example");
assert!(x.string_value().is_some());
assert!(x.bool_value().is_none());
assert!(x.string_list_value().is_none());
assert!(x.number_value().is_none());
assert!(x.oneof_value().is_none());Sourcepub fn bool_value(&self) -> Option<&bool>
pub fn bool_value(&self) -> Option<&bool>
The value of kind
if it holds a BoolValue, None if the field is not set or
holds a different branch.
Sourcepub fn set_bool_value<T: Into<bool>>(self, v: T) -> Self
pub fn set_bool_value<T: Into<bool>>(self, v: T) -> Self
Sets the value of kind
to hold a BoolValue.
Note that all the setters affecting kind are
mutually exclusive.
§Example
let x = ParamValue::new().set_bool_value(true);
assert!(x.bool_value().is_some());
assert!(x.string_value().is_none());
assert!(x.string_list_value().is_none());
assert!(x.number_value().is_none());
assert!(x.oneof_value().is_none());Sourcepub fn string_list_value(&self) -> Option<&Box<StringList>>
pub fn string_list_value(&self) -> Option<&Box<StringList>>
The value of kind
if it holds a StringListValue, None if the field is not set or
holds a different branch.
Sourcepub fn set_string_list_value<T: Into<Box<StringList>>>(self, v: T) -> Self
pub fn set_string_list_value<T: Into<Box<StringList>>>(self, v: T) -> Self
Sets the value of kind
to hold a StringListValue.
Note that all the setters affecting kind are
mutually exclusive.
§Example
use google_cloud_cloudsecuritycompliance_v1::model::StringList;
let x = ParamValue::new().set_string_list_value(StringList::default()/* use setters */);
assert!(x.string_list_value().is_some());
assert!(x.string_value().is_none());
assert!(x.bool_value().is_none());
assert!(x.number_value().is_none());
assert!(x.oneof_value().is_none());Sourcepub fn number_value(&self) -> Option<&f64>
pub fn number_value(&self) -> Option<&f64>
The value of kind
if it holds a NumberValue, None if the field is not set or
holds a different branch.
Sourcepub fn set_number_value<T: Into<f64>>(self, v: T) -> Self
pub fn set_number_value<T: Into<f64>>(self, v: T) -> Self
Sets the value of kind
to hold a NumberValue.
Note that all the setters affecting kind are
mutually exclusive.
§Example
let x = ParamValue::new().set_number_value(42.0);
assert!(x.number_value().is_some());
assert!(x.string_value().is_none());
assert!(x.bool_value().is_none());
assert!(x.string_list_value().is_none());
assert!(x.oneof_value().is_none());Sourcepub fn oneof_value(&self) -> Option<&Box<Parameter>>
pub fn oneof_value(&self) -> Option<&Box<Parameter>>
The value of kind
if it holds a OneofValue, None if the field is not set or
holds a different branch.
Sourcepub fn set_oneof_value<T: Into<Box<Parameter>>>(self, v: T) -> Self
pub fn set_oneof_value<T: Into<Box<Parameter>>>(self, v: T) -> Self
Sets the value of kind
to hold a OneofValue.
Note that all the setters affecting kind are
mutually exclusive.
§Example
use google_cloud_cloudsecuritycompliance_v1::model::Parameter;
let x = ParamValue::new().set_oneof_value(Parameter::default()/* use setters */);
assert!(x.oneof_value().is_some());
assert!(x.string_value().is_none());
assert!(x.bool_value().is_none());
assert!(x.string_list_value().is_none());
assert!(x.number_value().is_none());Trait Implementations§
Source§impl Clone for ParamValue
impl Clone for ParamValue
Source§fn clone(&self) -> ParamValue
fn clone(&self) -> ParamValue
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 ParamValue
impl Debug for ParamValue
Source§impl Default for ParamValue
impl Default for ParamValue
Source§fn default() -> ParamValue
fn default() -> ParamValue
Source§impl PartialEq for ParamValue
impl PartialEq for ParamValue
impl StructuralPartialEq for ParamValue
Auto Trait Implementations§
impl Freeze for ParamValue
impl RefUnwindSafe for ParamValue
impl Send for ParamValue
impl Sync for ParamValue
impl Unpin for ParamValue
impl UnsafeUnpin for ParamValue
impl UnwindSafe for ParamValue
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