#[non_exhaustive]pub struct NumericRestriction {
pub namespace: String,
pub op: Operator,
pub value: Option<Value>,
/* private fields */
}Expand description
This field allows restricts to be based on numeric comparisons rather than categorical tokens.
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.namespace: StringThe namespace of this restriction. e.g.: cost.
op: OperatorThis MUST be specified for queries and must NOT be specified for datapoints.
value: Option<Value>The type of Value must be consistent for all datapoints with a given namespace name. This is verified at runtime.
Implementations§
Source§impl NumericRestriction
impl NumericRestriction
pub fn new() -> Self
Sourcepub fn set_namespace<T: Into<String>>(self, v: T) -> Self
pub fn set_namespace<T: Into<String>>(self, v: T) -> Self
Sets the value of namespace.
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 value_int(&self) -> Option<&i64>
pub fn value_int(&self) -> Option<&i64>
The value of value
if it holds a ValueInt, None if the field is not set or
holds a different branch.
Sourcepub fn set_value_int<T: Into<i64>>(self, v: T) -> Self
pub fn set_value_int<T: Into<i64>>(self, v: T) -> Self
Sets the value of value
to hold a ValueInt.
Note that all the setters affecting value are
mutually exclusive.
Sourcepub fn value_float(&self) -> Option<&f32>
pub fn value_float(&self) -> Option<&f32>
The value of value
if it holds a ValueFloat, None if the field is not set or
holds a different branch.
Sourcepub fn set_value_float<T: Into<f32>>(self, v: T) -> Self
pub fn set_value_float<T: Into<f32>>(self, v: T) -> Self
Sets the value of value
to hold a ValueFloat.
Note that all the setters affecting value are
mutually exclusive.
Sourcepub fn value_double(&self) -> Option<&f64>
pub fn value_double(&self) -> Option<&f64>
The value of value
if it holds a ValueDouble, None if the field is not set or
holds a different branch.
Sourcepub fn set_value_double<T: Into<f64>>(self, v: T) -> Self
pub fn set_value_double<T: Into<f64>>(self, v: T) -> Self
Sets the value of value
to hold a ValueDouble.
Note that all the setters affecting value are
mutually exclusive.
Trait Implementations§
Source§impl Clone for NumericRestriction
impl Clone for NumericRestriction
Source§fn clone(&self) -> NumericRestriction
fn clone(&self) -> NumericRestriction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more