#[non_exhaustive]pub struct NumericRestriction {
pub namespace: String,
pub op: Operator,
pub value: Option<Value>,
/* private fields */
}Available on crate features
index-service or match-service only.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
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.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
Sourcepub fn set_op<T: Into<Operator>>(self, v: T) -> Self
pub fn set_op<T: Into<Operator>>(self, v: T) -> Self
Sets the value of op.
§Example
ⓘ
use google_cloud_aiplatform_v1::model::index_datapoint::numeric_restriction::Operator;
let x0 = NumericRestriction::new().set_op(Operator::Less);
let x1 = NumericRestriction::new().set_op(Operator::LessEqual);
let x2 = NumericRestriction::new().set_op(Operator::Equal);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
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
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
Trait Implementations§
Source§impl Clone for NumericRestriction
impl Clone for NumericRestriction
Source§fn clone(&self) -> NumericRestriction
fn clone(&self) -> NumericRestriction
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 NumericRestriction
impl Debug for NumericRestriction
Source§impl Default for NumericRestriction
impl Default for NumericRestriction
Source§fn default() -> NumericRestriction
fn default() -> NumericRestriction
Returns the “default value” for a type. Read more
Source§impl Message for NumericRestriction
impl Message for NumericRestriction
Source§impl PartialEq for NumericRestriction
impl PartialEq for NumericRestriction
impl StructuralPartialEq for NumericRestriction
Auto Trait Implementations§
impl Freeze for NumericRestriction
impl RefUnwindSafe for NumericRestriction
impl Send for NumericRestriction
impl Sync for NumericRestriction
impl Unpin for NumericRestriction
impl UnwindSafe for NumericRestriction
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