#[non_exhaustive]pub struct LabelValue {
pub value: Option<Value>,
}Expand description
A label value.
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 label value can be a bool, int64, or string.
Implementations§
Source§impl LabelValue
impl LabelValue
Sourcepub fn get_bool_value(&self) -> Option<&bool>
pub fn get_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 get_int64_value(&self) -> Option<&i64>
pub fn get_int64_value(&self) -> Option<&i64>
The value of value
if it holds a Int64Value, None if the field is not set or
holds a different branch.
Sourcepub fn get_string_value(&self) -> Option<&String>
pub fn get_string_value(&self) -> Option<&String>
The value of value
if it holds a StringValue, 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 value
to hold a BoolValue.
Note that all the setters affecting value are
mutually exclusive.
Sourcepub fn set_int64_value<T: Into<i64>>(self, v: T) -> Self
pub fn set_int64_value<T: Into<i64>>(self, v: T) -> Self
Sets the value of value
to hold a Int64Value.
Note that all the setters affecting value are
mutually exclusive.
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 value
to hold a StringValue.
Note that all the setters affecting value are
mutually exclusive.
Trait Implementations§
Source§impl Clone for LabelValue
impl Clone for LabelValue
Source§fn clone(&self) -> LabelValue
fn clone(&self) -> LabelValue
Returns a copy 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 LabelValue
impl Debug for LabelValue
Source§impl Default for LabelValue
impl Default for LabelValue
Source§fn default() -> LabelValue
fn default() -> LabelValue
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for LabelValuewhere
LabelValue: Default,
impl<'de> Deserialize<'de> for LabelValuewhere
LabelValue: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for LabelValue
impl PartialEq for LabelValue
Source§impl Serialize for LabelValue
impl Serialize for LabelValue
impl StructuralPartialEq for LabelValue
Auto Trait Implementations§
impl Freeze for LabelValue
impl RefUnwindSafe for LabelValue
impl Send for LabelValue
impl Sync for LabelValue
impl Unpin for LabelValue
impl UnwindSafe for LabelValue
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