#[non_exhaustive]pub struct MetricValue {
pub labels: HashMap<String, String>,
pub start_time: Option<Timestamp>,
pub end_time: Option<Timestamp>,
pub value: Option<Value>,
/* private fields */
}Expand description
Represents a single metric value.
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.labels: HashMap<String, String>The labels describing the metric value. See comments on google.api.servicecontrol.v1.Operation.labels for the overriding relationship. Note that this map must not contain monitored resource labels.
start_time: Option<Timestamp>The start of the time period over which this metric value’s measurement applies. The time period has different semantics for different metric types (cumulative, delta, and gauge). See the metric definition documentation in the service configuration for details. If not specified, google.api.servicecontrol.v1.Operation.start_time will be used.
end_time: Option<Timestamp>The end of the time period over which this metric value’s measurement applies. If not specified, google.api.servicecontrol.v1.Operation.end_time will be used.
value: Option<Value>The value. The type of value used in the request must agree with the metric definition in the service configuration, otherwise the MetricValue is rejected.
Implementations§
Source§impl MetricValue
impl MetricValue
pub fn new() -> Self
Sourcepub fn set_labels<T, K, V>(self, v: T) -> Self
pub fn set_labels<T, K, V>(self, v: T) -> Self
Sets the value of labels.
Sourcepub fn set_start_time<T>(self, v: T) -> Self
pub fn set_start_time<T>(self, v: T) -> Self
Sets the value of start_time.
Sourcepub fn set_or_clear_start_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_start_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of start_time.
Sourcepub fn set_end_time<T>(self, v: T) -> Self
pub fn set_end_time<T>(self, v: T) -> Self
Sets the value of end_time.
Sourcepub fn set_or_clear_end_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_end_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of end_time.
Sourcepub fn set_value<T: Into<Option<Value>>>(self, v: T) -> Self
pub fn set_value<T: Into<Option<Value>>>(self, v: T) -> Self
Sets the value of value.
Note that all the setters affecting value are mutually
exclusive.
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
Sets the value of value
to hold a BoolValue.
Note that all the setters affecting value are
mutually exclusive.
Sourcepub fn int64_value(&self) -> Option<&i64>
pub fn 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 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 double_value(&self) -> Option<&f64>
pub fn double_value(&self) -> Option<&f64>
The value of value
if it holds a DoubleValue, None if the field is not set or
holds a different branch.
Sourcepub fn set_double_value<T: Into<f64>>(self, v: T) -> Self
pub fn set_double_value<T: Into<f64>>(self, v: T) -> Self
Sets the value of value
to hold a DoubleValue.
Note that all the setters affecting value are
mutually exclusive.
Sourcepub fn string_value(&self) -> Option<&String>
pub fn 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_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.
Sourcepub fn distribution_value(&self) -> Option<&Box<Distribution>>
pub fn distribution_value(&self) -> Option<&Box<Distribution>>
The value of value
if it holds a DistributionValue, None if the field is not set or
holds a different branch.
Sourcepub fn set_distribution_value<T: Into<Box<Distribution>>>(self, v: T) -> Self
pub fn set_distribution_value<T: Into<Box<Distribution>>>(self, v: T) -> Self
Sets the value of value
to hold a DistributionValue.
Note that all the setters affecting value are
mutually exclusive.
Trait Implementations§
Source§impl Clone for MetricValue
impl Clone for MetricValue
Source§fn clone(&self) -> MetricValue
fn clone(&self) -> MetricValue
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more