#[non_exhaustive]pub struct Vector {
pub vector_type: Option<VectorType>,
/* private fields */
}Expand description
A vector which can be either dense or sparse.
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.vector_type: Option<VectorType>The type of the vector.
Implementations§
Source§impl Vector
impl Vector
pub fn new() -> Self
Sourcepub fn set_vector_type<T: Into<Option<VectorType>>>(self, v: T) -> Self
pub fn set_vector_type<T: Into<Option<VectorType>>>(self, v: T) -> Self
Sets the value of vector_type.
Note that all the setters affecting vector_type are mutually
exclusive.
§Example
ⓘ
use google_cloud_vectorsearch_v1::model::DenseVector;
let x = Vector::new().set_vector_type(Some(
google_cloud_vectorsearch_v1::model::vector::VectorType::Dense(DenseVector::default().into())));Sourcepub fn dense(&self) -> Option<&Box<DenseVector>>
pub fn dense(&self) -> Option<&Box<DenseVector>>
The value of vector_type
if it holds a Dense, None if the field is not set or
holds a different branch.
Sourcepub fn set_dense<T: Into<Box<DenseVector>>>(self, v: T) -> Self
pub fn set_dense<T: Into<Box<DenseVector>>>(self, v: T) -> Self
Sets the value of vector_type
to hold a Dense.
Note that all the setters affecting vector_type are
mutually exclusive.
§Example
ⓘ
use google_cloud_vectorsearch_v1::model::DenseVector;
let x = Vector::new().set_dense(DenseVector::default()/* use setters */);
assert!(x.dense().is_some());
assert!(x.sparse().is_none());Sourcepub fn sparse(&self) -> Option<&Box<SparseVector>>
pub fn sparse(&self) -> Option<&Box<SparseVector>>
The value of vector_type
if it holds a Sparse, None if the field is not set or
holds a different branch.
Sourcepub fn set_sparse<T: Into<Box<SparseVector>>>(self, v: T) -> Self
pub fn set_sparse<T: Into<Box<SparseVector>>>(self, v: T) -> Self
Sets the value of vector_type
to hold a Sparse.
Note that all the setters affecting vector_type are
mutually exclusive.
§Example
ⓘ
use google_cloud_vectorsearch_v1::model::SparseVector;
let x = Vector::new().set_sparse(SparseVector::default()/* use setters */);
assert!(x.sparse().is_some());
assert!(x.dense().is_none());Trait Implementations§
impl StructuralPartialEq for Vector
Auto Trait Implementations§
impl Freeze for Vector
impl RefUnwindSafe for Vector
impl Send for Vector
impl Sync for Vector
impl Unpin for Vector
impl UnsafeUnpin for Vector
impl UnwindSafe for Vector
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