#[non_exhaustive]pub struct FeatureValue {
pub metadata: Option<Metadata>,
pub value: Option<Value>,
/* private fields */
}feature-online-store-service or featurestore-online-serving-service only.Expand description
Value for a feature.
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.metadata: Option<Metadata>Metadata of feature value.
value: Option<Value>Value for the feature.
Implementations§
Source§impl FeatureValue
impl FeatureValue
pub fn new() -> Self
Sourcepub fn set_metadata<T>(self, v: T) -> Self
pub fn set_metadata<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_metadata<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_metadata<T>(self, v: Option<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
Sets the value of value
to hold a BoolValue.
Note that all the setters affecting value are
mutually exclusive.
§Example
let x = FeatureValue::new().set_bool_value(true);
assert!(x.bool_value().is_some());
assert!(x.double_value().is_none());
assert!(x.int64_value().is_none());
assert!(x.string_value().is_none());
assert!(x.bool_array_value().is_none());
assert!(x.double_array_value().is_none());
assert!(x.int64_array_value().is_none());
assert!(x.string_array_value().is_none());
assert!(x.bytes_value().is_none());
assert!(x.struct_value().is_none());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.
§Example
let x = FeatureValue::new().set_double_value(42.0);
assert!(x.double_value().is_some());
assert!(x.bool_value().is_none());
assert!(x.int64_value().is_none());
assert!(x.string_value().is_none());
assert!(x.bool_array_value().is_none());
assert!(x.double_array_value().is_none());
assert!(x.int64_array_value().is_none());
assert!(x.string_array_value().is_none());
assert!(x.bytes_value().is_none());
assert!(x.struct_value().is_none());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.
§Example
let x = FeatureValue::new().set_int64_value(42);
assert!(x.int64_value().is_some());
assert!(x.bool_value().is_none());
assert!(x.double_value().is_none());
assert!(x.string_value().is_none());
assert!(x.bool_array_value().is_none());
assert!(x.double_array_value().is_none());
assert!(x.int64_array_value().is_none());
assert!(x.string_array_value().is_none());
assert!(x.bytes_value().is_none());
assert!(x.struct_value().is_none());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.
§Example
let x = FeatureValue::new().set_string_value("example");
assert!(x.string_value().is_some());
assert!(x.bool_value().is_none());
assert!(x.double_value().is_none());
assert!(x.int64_value().is_none());
assert!(x.bool_array_value().is_none());
assert!(x.double_array_value().is_none());
assert!(x.int64_array_value().is_none());
assert!(x.string_array_value().is_none());
assert!(x.bytes_value().is_none());
assert!(x.struct_value().is_none());Sourcepub fn bool_array_value(&self) -> Option<&Box<BoolArray>>
pub fn bool_array_value(&self) -> Option<&Box<BoolArray>>
The value of value
if it holds a BoolArrayValue, None if the field is not set or
holds a different branch.
Sourcepub fn set_bool_array_value<T: Into<Box<BoolArray>>>(self, v: T) -> Self
pub fn set_bool_array_value<T: Into<Box<BoolArray>>>(self, v: T) -> Self
Sets the value of value
to hold a BoolArrayValue.
Note that all the setters affecting value are
mutually exclusive.
§Example
use google_cloud_aiplatform_v1::model::BoolArray;
let x = FeatureValue::new().set_bool_array_value(BoolArray::default()/* use setters */);
assert!(x.bool_array_value().is_some());
assert!(x.bool_value().is_none());
assert!(x.double_value().is_none());
assert!(x.int64_value().is_none());
assert!(x.string_value().is_none());
assert!(x.double_array_value().is_none());
assert!(x.int64_array_value().is_none());
assert!(x.string_array_value().is_none());
assert!(x.bytes_value().is_none());
assert!(x.struct_value().is_none());Sourcepub fn double_array_value(&self) -> Option<&Box<DoubleArray>>
pub fn double_array_value(&self) -> Option<&Box<DoubleArray>>
The value of value
if it holds a DoubleArrayValue, None if the field is not set or
holds a different branch.
Sourcepub fn set_double_array_value<T: Into<Box<DoubleArray>>>(self, v: T) -> Self
pub fn set_double_array_value<T: Into<Box<DoubleArray>>>(self, v: T) -> Self
Sets the value of value
to hold a DoubleArrayValue.
Note that all the setters affecting value are
mutually exclusive.
§Example
use google_cloud_aiplatform_v1::model::DoubleArray;
let x = FeatureValue::new().set_double_array_value(DoubleArray::default()/* use setters */);
assert!(x.double_array_value().is_some());
assert!(x.bool_value().is_none());
assert!(x.double_value().is_none());
assert!(x.int64_value().is_none());
assert!(x.string_value().is_none());
assert!(x.bool_array_value().is_none());
assert!(x.int64_array_value().is_none());
assert!(x.string_array_value().is_none());
assert!(x.bytes_value().is_none());
assert!(x.struct_value().is_none());Sourcepub fn int64_array_value(&self) -> Option<&Box<Int64Array>>
pub fn int64_array_value(&self) -> Option<&Box<Int64Array>>
The value of value
if it holds a Int64ArrayValue, None if the field is not set or
holds a different branch.
Sourcepub fn set_int64_array_value<T: Into<Box<Int64Array>>>(self, v: T) -> Self
pub fn set_int64_array_value<T: Into<Box<Int64Array>>>(self, v: T) -> Self
Sets the value of value
to hold a Int64ArrayValue.
Note that all the setters affecting value are
mutually exclusive.
§Example
use google_cloud_aiplatform_v1::model::Int64Array;
let x = FeatureValue::new().set_int64_array_value(Int64Array::default()/* use setters */);
assert!(x.int64_array_value().is_some());
assert!(x.bool_value().is_none());
assert!(x.double_value().is_none());
assert!(x.int64_value().is_none());
assert!(x.string_value().is_none());
assert!(x.bool_array_value().is_none());
assert!(x.double_array_value().is_none());
assert!(x.string_array_value().is_none());
assert!(x.bytes_value().is_none());
assert!(x.struct_value().is_none());Sourcepub fn string_array_value(&self) -> Option<&Box<StringArray>>
pub fn string_array_value(&self) -> Option<&Box<StringArray>>
The value of value
if it holds a StringArrayValue, None if the field is not set or
holds a different branch.
Sourcepub fn set_string_array_value<T: Into<Box<StringArray>>>(self, v: T) -> Self
pub fn set_string_array_value<T: Into<Box<StringArray>>>(self, v: T) -> Self
Sets the value of value
to hold a StringArrayValue.
Note that all the setters affecting value are
mutually exclusive.
§Example
use google_cloud_aiplatform_v1::model::StringArray;
let x = FeatureValue::new().set_string_array_value(StringArray::default()/* use setters */);
assert!(x.string_array_value().is_some());
assert!(x.bool_value().is_none());
assert!(x.double_value().is_none());
assert!(x.int64_value().is_none());
assert!(x.string_value().is_none());
assert!(x.bool_array_value().is_none());
assert!(x.double_array_value().is_none());
assert!(x.int64_array_value().is_none());
assert!(x.bytes_value().is_none());
assert!(x.struct_value().is_none());Sourcepub fn bytes_value(&self) -> Option<&Bytes>
pub fn bytes_value(&self) -> Option<&Bytes>
The value of value
if it holds a BytesValue, None if the field is not set or
holds a different branch.
Sourcepub fn set_bytes_value<T: Into<Bytes>>(self, v: T) -> Self
pub fn set_bytes_value<T: Into<Bytes>>(self, v: T) -> Self
Sets the value of value
to hold a BytesValue.
Note that all the setters affecting value are
mutually exclusive.
§Example
let x = FeatureValue::new().set_bytes_value(bytes::Bytes::from_static(b"example"));
assert!(x.bytes_value().is_some());
assert!(x.bool_value().is_none());
assert!(x.double_value().is_none());
assert!(x.int64_value().is_none());
assert!(x.string_value().is_none());
assert!(x.bool_array_value().is_none());
assert!(x.double_array_value().is_none());
assert!(x.int64_array_value().is_none());
assert!(x.string_array_value().is_none());
assert!(x.struct_value().is_none());Sourcepub fn struct_value(&self) -> Option<&Box<StructValue>>
pub fn struct_value(&self) -> Option<&Box<StructValue>>
The value of value
if it holds a StructValue, None if the field is not set or
holds a different branch.
Sourcepub fn set_struct_value<T: Into<Box<StructValue>>>(self, v: T) -> Self
pub fn set_struct_value<T: Into<Box<StructValue>>>(self, v: T) -> Self
Sets the value of value
to hold a StructValue.
Note that all the setters affecting value are
mutually exclusive.
§Example
use google_cloud_aiplatform_v1::model::StructValue;
let x = FeatureValue::new().set_struct_value(StructValue::default()/* use setters */);
assert!(x.struct_value().is_some());
assert!(x.bool_value().is_none());
assert!(x.double_value().is_none());
assert!(x.int64_value().is_none());
assert!(x.string_value().is_none());
assert!(x.bool_array_value().is_none());
assert!(x.double_array_value().is_none());
assert!(x.int64_array_value().is_none());
assert!(x.string_array_value().is_none());
assert!(x.bytes_value().is_none());Trait Implementations§
Source§impl Clone for FeatureValue
impl Clone for FeatureValue
Source§fn clone(&self) -> FeatureValue
fn clone(&self) -> FeatureValue
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more