#[repr(u8)]pub enum EmbeddingSubType {
Float32 = 0,
Int8 = 1,
Binary = 2,
}Expand description
Embedding sub-types (spec Section 2.4).
Variants§
Float32 = 0
32-bit IEEE 754 float, little-endian (4 bytes per dim)
Int8 = 1
Signed 8-bit integer (1 byte per dim)
Binary = 2
Bit-packed binary, LSB-first (1/8 byte per dim)
Implementations§
Source§impl EmbeddingSubType
impl EmbeddingSubType
Sourcepub fn from_u8(v: u8) -> Option<EmbeddingSubType>
pub fn from_u8(v: u8) -> Option<EmbeddingSubType>
Creates an EmbeddingSubType from its wire representation.
Sourcepub fn bytes_for_dims(self, dims: usize) -> usize
pub fn bytes_for_dims(self, dims: usize) -> usize
Returns the number of bytes needed for the given number of dimensions.
Trait Implementations§
Source§impl Clone for EmbeddingSubType
impl Clone for EmbeddingSubType
Source§fn clone(&self) -> EmbeddingSubType
fn clone(&self) -> EmbeddingSubType
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 EmbeddingSubType
impl Debug for EmbeddingSubType
Source§impl Hash for EmbeddingSubType
impl Hash for EmbeddingSubType
Source§impl PartialEq for EmbeddingSubType
impl PartialEq for EmbeddingSubType
impl Copy for EmbeddingSubType
impl Eq for EmbeddingSubType
impl StructuralPartialEq for EmbeddingSubType
Auto Trait Implementations§
impl Freeze for EmbeddingSubType
impl RefUnwindSafe for EmbeddingSubType
impl Send for EmbeddingSubType
impl Sync for EmbeddingSubType
impl Unpin for EmbeddingSubType
impl UnwindSafe for EmbeddingSubType
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