pub enum VectorValue {
Binary32(Vec<u8>),
Binary64(Vec<u8>),
Fp16(Vec<u16>),
Fp32(Vec<f32>),
Fp64(Vec<f64>),
Int4(Vec<i8>),
Int8(Vec<i8>),
Int16(Vec<i16>),
SparseFp16 {
indices: Vec<u32>,
values: Vec<u16>,
},
SparseFp32 {
indices: Vec<u32>,
values: Vec<f32>,
},
}Expand description
Dense and sparse vector payloads.
FP16 values are raw IEEE 754 half-precision bits. INT4/INT8/INT16 values are authoritative integer coordinates, not scale-bearing index quantization. Binary values are packed bytes in 32- or 64-bit chunks.
Variants§
Binary32(Vec<u8>)
Binary64(Vec<u8>)
Fp16(Vec<u16>)
Fp32(Vec<f32>)
Fp64(Vec<f64>)
Int4(Vec<i8>)
Int8(Vec<i8>)
Int16(Vec<i16>)
SparseFp16
SparseFp32
Implementations§
Source§impl VectorValue
impl VectorValue
Sourcepub fn encode_fp16(values: &[f32]) -> Result<Self>
pub fn encode_fp16(values: &[f32]) -> Result<Self>
Encodes finite f32 coordinates as IEEE 754 half-precision bits.
pub fn data_type(&self) -> DataType
pub fn dimension(&self) -> usize
pub fn is_sparse(&self) -> bool
Sourcepub fn to_dense_f32(&self) -> Option<Vec<f32>>
pub fn to_dense_f32(&self) -> Option<Vec<f32>>
Converts numeric dense forms to f32 for adapters that require it.
FP64 coordinates may be narrowed. The exact collection executor uses
Self::to_dense_f64 instead.
Sourcepub fn to_dense_f64(&self) -> Option<Vec<f64>>
pub fn to_dense_f64(&self) -> Option<Vec<f64>>
Decodes all numeric dense forms without narrowing FP64 coordinates.
pub fn to_sparse_f64(&self) -> Option<BTreeMap<u32, f64>>
Trait Implementations§
Source§impl Clone for VectorValue
impl Clone for VectorValue
Source§impl Debug for VectorValue
impl Debug for VectorValue
Source§impl<'de> Deserialize<'de> for VectorValue
impl<'de> Deserialize<'de> for VectorValue
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for VectorValue
impl PartialEq for VectorValue
Source§impl Serialize for VectorValue
impl Serialize for VectorValue
impl StructuralPartialEq for VectorValue
Auto Trait Implementations§
impl Freeze for VectorValue
impl RefUnwindSafe for VectorValue
impl Send for VectorValue
impl Sync for VectorValue
impl Unpin for VectorValue
impl UnsafeUnpin for VectorValue
impl UnwindSafe for VectorValue
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more