#[non_exhaustive]pub struct AttributeValue {
pub value: Option<Value>,
/* private fields */
}Expand description
The allowed types for [VALUE] in a [KEY]:[VALUE] attribute.
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.value: Option<Value>The type of the value.
Implementations§
Source§impl AttributeValue
impl AttributeValue
pub fn new() -> Self
Sourcepub fn string_value(&self) -> Option<&Box<TruncatableString>>
pub fn string_value(&self) -> Option<&Box<TruncatableString>>
The value of value
if it holds a StringValue, None if the field is not set or
holds a different branch.
Sourcepub fn set_string_value<T: Into<Box<TruncatableString>>>(self, v: T) -> Self
pub fn set_string_value<T: Into<Box<TruncatableString>>>(self, v: T) -> Self
Sets the value of value
to hold a StringValue.
Note that all the setters affecting value are
mutually exclusive.
§Example
ⓘ
use google_cloud_trace_v2::model::TruncatableString;
let x = AttributeValue::new().set_string_value(TruncatableString::default()/* use setters */);
assert!(x.string_value().is_some());
assert!(x.int_value().is_none());
assert!(x.bool_value().is_none());Sourcepub fn int_value(&self) -> Option<&i64>
pub fn int_value(&self) -> Option<&i64>
The value of value
if it holds a IntValue, None if the field is not set or
holds a different branch.
Sourcepub fn set_int_value<T: Into<i64>>(self, v: T) -> Self
pub fn set_int_value<T: Into<i64>>(self, v: T) -> Self
Sourcepub fn bool_value(&self) -> Option<&bool>
pub fn bool_value(&self) -> Option<&bool>
The value of value
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
Trait Implementations§
Source§impl Clone for AttributeValue
impl Clone for AttributeValue
Source§fn clone(&self) -> AttributeValue
fn clone(&self) -> AttributeValue
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 AttributeValue
impl Debug for AttributeValue
Source§impl Default for AttributeValue
impl Default for AttributeValue
Source§fn default() -> AttributeValue
fn default() -> AttributeValue
Returns the “default value” for a type. Read more
Source§impl Message for AttributeValue
impl Message for AttributeValue
Source§impl PartialEq for AttributeValue
impl PartialEq for AttributeValue
impl StructuralPartialEq for AttributeValue
Auto Trait Implementations§
impl Freeze for AttributeValue
impl RefUnwindSafe for AttributeValue
impl Send for AttributeValue
impl Sync for AttributeValue
impl Unpin for AttributeValue
impl UnwindSafe for AttributeValue
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